TmstruckLeaveFactoryResultMapper.xml 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.steerinfo.dil.mapper.TmstruckLeaveFactoryResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId" />
  8. <result column="RESULT_OUT_MODE" jdbcType="VARCHAR" property="resultOutMode" />
  9. <result column="RESULT_OUT_GATE_TIME" jdbcType="TIMESTAMP" property="resultOutGateTime" />
  10. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  11. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  12. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  13. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  15. <result column="DELETE_USERNAME" jdbcType="VARCHAR" property="deleteUsername" />
  16. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  17. <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
  18. <result column="RESULT_TRUCK_SNAPSHOT_PICTURE" jdbcType="BLOB" property="resultTruckSnapshotPicture" />
  19. </resultMap>
  20. <sql id="columns">
  21. RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_OUT_MODE, RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  22. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_USERNAME,
  23. DELETE_TIME, SEGMENT_SQE, RESULT_TRUCK_SNAPSHOT_PICTURE
  24. </sql>
  25. <sql id="columns_alias">
  26. t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_OUT_MODE, t.RESULT_OUT_GATE_TIME,
  27. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  28. t.DELETE_USERNAME, t.DELETE_TIME, t.SEGMENT_SQE, t.RESULT_TRUCK_SNAPSHOT_PICTURE
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns"/> FROM TMSTRUCK_LEAVE_FACTORY_RESULT
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias"/> FROM TMSTRUCK_LEAVE_FACTORY_RESULT t
  35. </sql>
  36. <sql id="where">
  37. <where>
  38. <if test="resultId != null">
  39. and RESULT_ID = #{resultId}
  40. </if>
  41. <if test="resultTotalId != null">
  42. and RESULT_TOTAL_ID = #{resultTotalId}
  43. </if>
  44. <if test="gatepostId != null">
  45. and GATEPOST_ID = #{gatepostId}
  46. </if>
  47. <if test="resultOutMode != null and resultOutMode != ''">
  48. and RESULT_OUT_MODE = #{resultOutMode}
  49. </if>
  50. <if test="resultOutGateTime != null">
  51. and TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = #{resultOutGateTime}
  52. </if>
  53. <if test="insertUsername != null and insertUsername != ''">
  54. and INSERT_USERNAME = #{insertUsername}
  55. </if>
  56. <if test="insertTime != null">
  57. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  58. </if>
  59. <if test="updateUsername != null and updateUsername != ''">
  60. and UPDATE_USERNAME = #{updateUsername}
  61. </if>
  62. <if test="updateTime != null">
  63. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  64. </if>
  65. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  66. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  67. </if>
  68. <if test="deleteUsername != null and deleteUsername != ''">
  69. and DELETE_USERNAME = #{deleteUsername}
  70. </if>
  71. <if test="deleteTime != null">
  72. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  73. </if>
  74. <if test="segmentSqe != null">
  75. and SEGMENT_SQE = #{segmentSqe}
  76. </if>
  77. <if test="resultTruckSnapshotPicture != null">
  78. and RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="resultId != null">
  85. and RESULT_ID = #{resultId}
  86. </if>
  87. <if test="resultTotalId != null">
  88. and RESULT_TOTAL_ID = #{resultTotalId}
  89. </if>
  90. <if test="gatepostId != null">
  91. and GATEPOST_ID = #{gatepostId}
  92. </if>
  93. <if test="resultOutMode != null and resultOutMode != ''">
  94. and RESULT_OUT_MODE LIKE '%${resultOutMode}%'
  95. </if>
  96. <if test="resultOutGateTime != null">
  97. and TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = #{resultOutGateTime}
  98. </if>
  99. <if test="insertUsername != null and insertUsername != ''">
  100. and INSERT_USERNAME LIKE '%${insertUsername}%'
  101. </if>
  102. <if test="insertTime != null">
  103. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  104. </if>
  105. <if test="updateUsername != null and updateUsername != ''">
  106. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  107. </if>
  108. <if test="updateTime != null">
  109. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  110. </if>
  111. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  112. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  113. </if>
  114. <if test="deleteUsername != null and deleteUsername != ''">
  115. and DELETE_USERNAME LIKE '%${deleteUsername}%'
  116. </if>
  117. <if test="deleteTime != null">
  118. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  119. </if>
  120. <if test="segmentSqe != null">
  121. and SEGMENT_SQE = #{segmentSqe}
  122. </if>
  123. <if test="resultTruckSnapshotPicture != null">
  124. and RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  125. </if>
  126. </where>
  127. </sql>
  128. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  129. delete from TMSTRUCK_LEAVE_FACTORY_RESULT
  130. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from TMSTRUCK_LEAVE_FACTORY_RESULT
  134. where 1!=1
  135. <if test="resultTotalId != null">
  136. or RESULT_TOTAL_ID = #{resultTotalId}
  137. </if>
  138. <if test="gatepostId != null">
  139. or GATEPOST_ID = #{gatepostId}
  140. </if>
  141. <if test="resultOutMode != null and resultOutMode != ''">
  142. or RESULT_OUT_MODE = #{resultOutMode}
  143. </if>
  144. <if test="resultOutGateTime != null">
  145. or TO_CHAR(RESULT_OUT_GATE_TIME,'yyyy-MM-dd') = '#{resultOutGateTime}'
  146. </if>
  147. <if test="insertUsername != null and insertUsername != ''">
  148. or INSERT_USERNAME = #{insertUsername}
  149. </if>
  150. <if test="insertTime != null">
  151. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  152. </if>
  153. <if test="updateUsername != null and updateUsername != ''">
  154. or UPDATE_USERNAME = #{updateUsername}
  155. </if>
  156. <if test="updateTime != null">
  157. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  158. </if>
  159. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  160. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  161. </if>
  162. <if test="deleteUsername != null and deleteUsername != ''">
  163. or DELETE_USERNAME = #{deleteUsername}
  164. </if>
  165. <if test="deleteTime != null">
  166. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  167. </if>
  168. <if test="segmentSqe != null">
  169. or SEGMENT_SQE = #{segmentSqe}
  170. </if>
  171. <if test="resultTruckSnapshotPicture != null">
  172. or RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  176. insert into TMSTRUCK_LEAVE_FACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID,
  177. RESULT_OUT_MODE, RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  178. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  179. INSERT_UPDATE_REMARK, DELETE_USERNAME, DELETE_TIME,
  180. SEGMENT_SQE, RESULT_TRUCK_SNAPSHOT_PICTURE)
  181. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL},
  182. #{resultOutMode,jdbcType=VARCHAR}, #{resultOutGateTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
  183. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  184. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleteUsername,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP},
  185. #{segmentSqe,jdbcType=DECIMAL}, #{resultTruckSnapshotPicture,jdbcType=BLOB})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  188. insert into TMSTRUCK_LEAVE_FACTORY_RESULT
  189. <trim prefix="(" suffix=")" suffixOverrides=",">
  190. <if test="resultId != null">
  191. RESULT_ID,
  192. </if>
  193. <if test="resultTotalId != null">
  194. RESULT_TOTAL_ID,
  195. </if>
  196. <if test="gatepostId != null">
  197. GATEPOST_ID,
  198. </if>
  199. <if test="resultOutMode != null">
  200. RESULT_OUT_MODE,
  201. </if>
  202. <if test="resultOutGateTime != null">
  203. RESULT_OUT_GATE_TIME,
  204. </if>
  205. <if test="insertUsername != null">
  206. INSERT_USERNAME,
  207. </if>
  208. <if test="insertTime != null">
  209. INSERT_TIME,
  210. </if>
  211. <if test="updateUsername != null">
  212. UPDATE_USERNAME,
  213. </if>
  214. <if test="updateTime != null">
  215. UPDATE_TIME,
  216. </if>
  217. <if test="insertUpdateRemark != null">
  218. INSERT_UPDATE_REMARK,
  219. </if>
  220. <if test="deleteUsername != null">
  221. DELETE_USERNAME,
  222. </if>
  223. <if test="deleteTime != null">
  224. DELETE_TIME,
  225. </if>
  226. <if test="segmentSqe != null">
  227. SEGMENT_SQE,
  228. </if>
  229. <if test="resultTruckSnapshotPicture != null">
  230. RESULT_TRUCK_SNAPSHOT_PICTURE,
  231. </if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="resultId != null">
  235. #{resultId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="resultTotalId != null">
  238. #{resultTotalId,jdbcType=DECIMAL},
  239. </if>
  240. <if test="gatepostId != null">
  241. #{gatepostId,jdbcType=DECIMAL},
  242. </if>
  243. <if test="resultOutMode != null">
  244. #{resultOutMode,jdbcType=VARCHAR},
  245. </if>
  246. <if test="resultOutGateTime != null">
  247. #{resultOutGateTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="insertUsername != null">
  250. #{insertUsername,jdbcType=VARCHAR},
  251. </if>
  252. <if test="insertTime != null">
  253. #{insertTime,jdbcType=TIMESTAMP},
  254. </if>
  255. <if test="updateUsername != null">
  256. #{updateUsername,jdbcType=VARCHAR},
  257. </if>
  258. <if test="updateTime != null">
  259. #{updateTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="insertUpdateRemark != null">
  262. #{insertUpdateRemark,jdbcType=VARCHAR},
  263. </if>
  264. <if test="deleteUsername != null">
  265. #{deleteUsername,jdbcType=VARCHAR},
  266. </if>
  267. <if test="deleteTime != null">
  268. #{deleteTime,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="segmentSqe != null">
  271. #{segmentSqe,jdbcType=DECIMAL},
  272. </if>
  273. <if test="resultTruckSnapshotPicture != null">
  274. #{resultTruckSnapshotPicture,jdbcType=BLOB},
  275. </if>
  276. </trim>
  277. </insert>
  278. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  279. update TMSTRUCK_LEAVE_FACTORY_RESULT
  280. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  281. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  282. RESULT_OUT_MODE = #{resultOutMode,jdbcType=VARCHAR},
  283. RESULT_OUT_GATE_TIME = #{resultOutGateTime,jdbcType=TIMESTAMP},
  284. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  285. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  286. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  287. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  288. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  289. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  290. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  291. SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
  292. RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture,jdbcType=BLOB}
  293. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  294. </update>
  295. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  296. update TMSTRUCK_LEAVE_FACTORY_RESULT
  297. <set>
  298. <if test="resultTotalId != null">
  299. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  300. </if>
  301. <if test="gatepostId != null">
  302. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  303. </if>
  304. <if test="resultOutMode != null">
  305. RESULT_OUT_MODE = #{resultOutMode,jdbcType=VARCHAR},
  306. </if>
  307. <if test="resultOutGateTime != null">
  308. RESULT_OUT_GATE_TIME = #{resultOutGateTime,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="insertUsername != null">
  311. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  312. </if>
  313. <if test="insertTime != null">
  314. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  315. </if>
  316. <if test="updateUsername != null">
  317. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  318. </if>
  319. <if test="updateTime != null">
  320. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  321. </if>
  322. <if test="insertUpdateRemark != null">
  323. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  324. </if>
  325. <if test="deleteUsername != null">
  326. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  327. </if>
  328. <if test="deleteTime != null">
  329. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  330. </if>
  331. <if test="segmentSqe != null">
  332. SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
  333. </if>
  334. <if test="resultTruckSnapshotPicture != null">
  335. RESULT_TRUCK_SNAPSHOT_PICTURE = #{resultTruckSnapshotPicture,jdbcType=BLOB},
  336. </if>
  337. </set>
  338. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  339. </update>
  340. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  341. <include refid="select"/>
  342. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  343. </select>
  344. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  345. <include refid="select"/>
  346. <include refid="where"/>
  347. </select>
  348. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  349. <include refid="select"/>
  350. <include refid="whereLike"/>
  351. </select>
  352. <insert id="batchInsert" parameterType="java.util.List">
  353. insert into TMSTRUCK_LEAVE_FACTORY_RESULT
  354. (RESULT_ID,
  355. RESULT_TOTAL_ID, GATEPOST_ID, RESULT_OUT_MODE,
  356. RESULT_OUT_GATE_TIME, INSERT_USERNAME,
  357. INSERT_TIME, UPDATE_USERNAME,
  358. UPDATE_TIME, INSERT_UPDATE_REMARK,
  359. DELETE_USERNAME, DELETE_TIME,
  360. SEGMENT_SQE, RESULT_TRUCK_SNAPSHOT_PICTURE
  361. )
  362. ( <foreach collection="list" item="item" separator="union all">
  363. select
  364. #{item.resultId,jdbcType=DECIMAL},
  365. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL}, #{item.resultOutMode,jdbcType=VARCHAR},
  366. #{item.resultOutGateTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  367. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  368. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  369. #{item.deleteUsername,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
  370. #{item.segmentSqe,jdbcType=DECIMAL}, #{item.resultTruckSnapshotPicture,jdbcType=BLOB}
  371. from dual
  372. </foreach> )
  373. </insert>
  374. <update id="batchUpdate" parameterType="java.util.List">
  375. update TMSTRUCK_LEAVE_FACTORY_RESULT
  376. set
  377. RESULT_ID=
  378. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  379. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  380. </foreach>
  381. ,RESULT_TOTAL_ID=
  382. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  383. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  384. </foreach>
  385. ,GATEPOST_ID=
  386. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  387. when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
  388. </foreach>
  389. ,RESULT_OUT_MODE=
  390. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  391. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutMode,jdbcType=VARCHAR}
  392. </foreach>
  393. ,RESULT_OUT_GATE_TIME=
  394. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  395. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutGateTime,jdbcType=TIMESTAMP}
  396. </foreach>
  397. ,INSERT_USERNAME=
  398. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  399. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  400. </foreach>
  401. ,INSERT_TIME=
  402. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  403. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  404. </foreach>
  405. ,UPDATE_USERNAME=
  406. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  407. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  408. </foreach>
  409. ,UPDATE_TIME=
  410. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  411. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  412. </foreach>
  413. ,INSERT_UPDATE_REMARK=
  414. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  415. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  416. </foreach>
  417. ,DELETE_USERNAME=
  418. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  419. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,jdbcType=VARCHAR}
  420. </foreach>
  421. ,DELETE_TIME=
  422. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  423. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  424. </foreach>
  425. ,SEGMENT_SQE=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  427. when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
  428. </foreach>
  429. ,RESULT_TRUCK_SNAPSHOT_PICTURE=
  430. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  431. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTruckSnapshotPicture,jdbcType=BLOB}
  432. </foreach>
  433. where RESULT_ID in
  434. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  435. #{item.resultId,jdbcType=DECIMAL}
  436. </foreach>
  437. </update>
  438. <delete id="batchDelete" parameterType="java.util.List">
  439. delete from TMSTRUCK_LEAVE_FACTORY_RESULT
  440. where RESULT_ID in
  441. <foreach collection="list" item="id" open="(" close=")" separator=",">
  442. #{id}
  443. </foreach>
  444. </delete>
  445. <!-- 友情提示!!!-->
  446. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  447. <sql id="orderByOutTime">
  448. <if test="orderField != null and orderField != ''">
  449. order by "${orderField}"
  450. <if test="orderType != null and orderType != ''">
  451. ${orderType}
  452. </if>
  453. </if>
  454. <if test="orderField == null ">
  455. order by "resultOutGateTime" desc
  456. </if>
  457. </sql>
  458. <!-- 查询采购所有的出厂实绩 -->
  459. <select id="getCGLeaveFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  460. select *
  461. from (
  462. select
  463. TLFR.RESULT_ID "resultId",
  464. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  465. RM.MATERIAL_NAME "materialName",
  466. TWR.RESULT_NET_WEIGHT "netWeight",
  467. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  468. OO.ORDER_NUMBER "orderNumber",
  469. RC.CAPACITY_NUMBER "capacityNumber",
  470. RG.GATEPOST_NAME "gatepostName",
  471. TLFR.RESULT_OUT_MODE "resultOutMode",
  472. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  473. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  474. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  475. left join TMSTRUCK_TOTAL_RESULT TTR
  476. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  477. left join TMSTRUCK_WEIGHT_RESULT TWR
  478. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  479. left join OMSTRUCK_ORDER OO
  480. on OO.ORDER_ID = TTR.ORDER_ID
  481. left join AMS_PURCHASE_ORDER APO
  482. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  483. left join DIL_BATCH DB
  484. on DB.BATCH_ID = APO.BATCH_ID
  485. left join OMSTRUCK_ORDER_MATERIAL OOM
  486. on OOM.ORDER_ID = OO.ORDER_ID
  487. left join RMS_MATERIAL RM
  488. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  489. left join RMS_CAPACITY RC
  490. on RC.CAPACITY_ID = OO.CAPACITY_ID
  491. <if test="carrierSsoId != null">
  492. left join RMS_CARRIER RCA
  493. on RCA.CARRIER_ID = OO.CARRIER_ID
  494. </if>
  495. left join RMS_GATEPOST RG
  496. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  497. where RESULT_OUT_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  498. <if test="carrierSsoId != null">
  499. and RCA.CARRIER_SSO_ID = #{carrierSsoId}
  500. </if>
  501. <if test="oneDate != null">
  502. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  503. </if>
  504. <if test="startDate != null">
  505. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  506. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  507. </if>
  508. )
  509. <where>
  510. <if test="purchaseOrderNo != null">
  511. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  512. "purchaseOrderNo" like '%${item}%'
  513. </foreach>
  514. </if>
  515. <if test="materialName != null">
  516. and
  517. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  518. "materialName" like '%${item}%'
  519. </foreach>
  520. </if>
  521. <if test="netWeight != null">
  522. and
  523. <foreach collection="netWeight" item="item" open="(" separator="or" close=")">
  524. "netWeight" like '%${item}%'
  525. </foreach>
  526. </if>
  527. <if test="resultForeignShipName != null">
  528. and
  529. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  530. "resultForeignShipName" like '%${item}%'
  531. </foreach>
  532. </if>
  533. <if test="orderNumber != null">
  534. and
  535. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  536. "orderNumber" like '%${item}%'
  537. </foreach>
  538. </if>
  539. <if test="capacityNumber != null">
  540. and
  541. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  542. "capacityNumber" like '%${item}%'
  543. </foreach>
  544. </if>
  545. <if test="gatepostName != null">
  546. and
  547. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  548. "gatepostName" like '%${item}%'
  549. </foreach>
  550. </if>
  551. <if test="resultOutMode != null">
  552. and
  553. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  554. "resultOutMode" like '%${item}%'
  555. </foreach>
  556. </if>
  557. <if test="resultOutGateTime != null">
  558. and
  559. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  560. "resultOutGateTime" like '%${item}%'
  561. </foreach>
  562. </if>
  563. <if test="resultTruckSnapshotPicture != null">
  564. and
  565. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  566. "resultTruckSnapshotPicture" like '%${item}%'
  567. </foreach>
  568. </if>
  569. </where>
  570. <include refid="orderByOutTime"></include>
  571. </select>
  572. <!-- 通过运输订单号查询 路段顺序号是否为 4 :已计皮-->
  573. <select id="selectTransportRoute" parameterType="string" resultType="int">
  574. select ORDER_LINE_SEQUENCE
  575. from OMSTRUCK_ORDER
  576. where ORDER_NUMBER = #{orderNumber}
  577. </select>
  578. <!-- 通过运输订单号查询 出厂门岗ID 和 实绩ID -->
  579. <select id="selectCnAndGnByOrderNumber" parameterType="string" resultType="java.util.Map">
  580. select RL.LINE_END_NODE_ID "lineEndNodeId",
  581. TTR.RESULT_TOTAL_ID "resultTotalId"
  582. from OMSTRUCK_ORDER OO
  583. left join TMSTRUCK_TOTAL_RESULT TTR
  584. on TTR.ORDER_ID = OO.ORDER_ID
  585. left join RMS_LINE RL
  586. on RL.LINE_ID = OO.LINE_ID
  587. where OO.ORDER_NUMBER = #{orderNumber}
  588. </select>
  589. <!-- 通过运输订单号获取实绩ID -->
  590. <select id="selectResultId" parameterType="string" resultType="java.util.Map">
  591. select *
  592. from (
  593. select TLFR.RESULT_ID "resultId",
  594. OO.ORDER_ID "orderId",
  595. OO.ORDER_TYPE "orderTypee",
  596. TTR.RESULT_TOTAL_ID "resultTotalId",
  597. TLFR.SEGMENT_SQE "segmentSqe",
  598. from OMSTRUCK_ORDER OO
  599. left join TMSTRUCK_TOTAL_RESULT TTR
  600. on OO.ORDER_ID = TTR.ORDER_ID
  601. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  602. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  603. where OO.ORDER_NUMBER = #{orderNumber} and TLFR.RESULT_OUT_GATE_TIME is null
  604. order by TLFR.SEGMENT_SQE
  605. )
  606. where rownum = 1
  607. </select>
  608. <!--销售物流查询所有的出厂实绩-->
  609. <select id="selectAllLeaveFacatoryForSale" resultType="java.util.Map">
  610. select *
  611. from (
  612. select
  613. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  614. TLFR.RESULT_OUT_MODE "resultOutMode",
  615. RG.GATEPOST_NAME "gatepostName",
  616. OO.ORDER_NUMBER "orderNumber",
  617. RC.CAPACITY_NUMBER "capacityNumber",
  618. OO.ORDER_ID "orderId",
  619. ASO.SALE_NUMBER "saleNum",
  620. RS.SUPPLIER_NAME "shipperName",
  621. RCON.CONSIGNEE_COMPANY_NAME "supplierName"
  622. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  623. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  624. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  625. LEFT JOIN OMSTRUCK_ORDER OO
  626. ON OO.ORDER_ID = TTR.ORDER_ID
  627. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
  628. ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  629. LEFT JOIN AMS_SALE_ORDER ASO
  630. ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  631. LEFT JOIN RMS_GATEPOST RG
  632. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  633. LEFT JOIN RMS_CAPACITY RC
  634. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  635. LEFT JOIN RMS_SUPPLIER RS
  636. ON RS.SUPPLIER_ID = ASO.SHIPPER_ID
  637. LEFT JOIN RMS_CONSIGNEE RCON
  638. ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  639. WHERE TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  640. AND OO.ORDER_TYPE IN (1, 2, 3)
  641. <if test="oneDate != null">
  642. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  643. </if>
  644. <if test="startDate != null">
  645. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  646. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  647. </if>
  648. )
  649. <where>
  650. <if test="saleNum != null">
  651. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  652. "saleNum" like '%${item}%'
  653. </foreach>
  654. </if>
  655. <if test="gatepostName != null">
  656. and
  657. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  658. "gatepostName" like '%${item}%'
  659. </foreach>
  660. </if>
  661. <if test="orderNumber != null">
  662. and
  663. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  664. "orderNumber" like '%${item}%'
  665. </foreach>
  666. </if>
  667. <if test="capacityNumber != null">
  668. and
  669. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  670. "capacityNumber" like '%${item}%'
  671. </foreach>
  672. </if>
  673. <if test="shipperName != null">
  674. and
  675. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  676. "shipperName" like '%${item}%'
  677. </foreach>
  678. </if>
  679. <if test="resultEntryMode != null">
  680. and
  681. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  682. "resultEntryMode" like '%${item}%'
  683. </foreach>
  684. </if>
  685. <if test="resultEntryGateTime != null">
  686. and
  687. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  688. "resultEntryGateTime" like '%${item}%'
  689. </foreach>
  690. </if>
  691. <if test="supplierName != null">
  692. and
  693. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  694. "supplierName" like '%${item}%'
  695. </foreach>
  696. </if>
  697. </where>
  698. <include refid="orderByOutTime"></include>
  699. </select>
  700. <!-- 通过总实绩Id 查询出厂实绩ID -->
  701. <select id="getResultIdByTotalId" parameterType="int" resultType="java.math.BigDecimal">
  702. select *
  703. from (
  704. select TLFR.RESULT_ID
  705. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  706. where TLFR.RESULT_TOTAL_ID = #{resultTotalId}
  707. and TLFR.RESULT_OUT_GATE_TIME is null
  708. order by TLFR.SEGMENT_SQE
  709. )
  710. where rownum = 1
  711. </select>
  712. <select id="getTruckFactoryResult" resultType="java.util.Map">
  713. SELECT * from(
  714. SELECT
  715. -- 出厂时间
  716. to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
  717. --出厂抓拍图片
  718. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  719. --出厂方式
  720. TLFR.RESULT_OUT_MODE "resultOutMode",
  721. --门岗名称
  722. RG.GATEPOST_NAME "gatepostName",
  723. -- 运输订单号
  724. OO.ORDER_NUMBER "orderNumber",
  725. -- 车牌号
  726. RC.CAPACITY_NUMBER "capacityNumber",
  727. -- 运输订单id
  728. OO.ORDER_ID "orderId",
  729. -- 订单类型
  730. OO.ORDER_TYPE "orderType",
  731. -- 销售订单号
  732. ASO.SALE_NUMBER "saleNum",
  733. -- 收货地址
  734. RRA.ADDRESS_DELIVERY_ADDRESS "receiveAddress",
  735. -- 收货单位
  736. RS.SUPPLIER_NAME "supplierName" ,
  737. -- 发货单位
  738. RS2.SHIPPER_NAME "shipperName"
  739. FROM
  740. -- 出厂实绩
  741. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  742. -- 总实绩
  743. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  744. -- 运输订单
  745. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  746. -- 销售订单信息
  747. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  748. -- 托运人
  749. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  750. -- 门岗
  751. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  752. -- 运力信息
  753. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  754. -- 销售订单中间表
  755. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
  756. -- 收货地址
  757. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID =RRA.ADDRESS_ID
  758. -- 收货单位
  759. LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
  760. WHERE
  761. -- 判断出厂实绩的出厂时间不为空
  762. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  763. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  764. AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
  765. )
  766. </select>
  767. <!-- 查询内转钢材到异地库出厂实绩 -->
  768. <select id="selectSteelNzLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  769. SELECT
  770. *
  771. FROM (
  772. SELECT
  773. OO.ORDER_ID "orderId",
  774. TLFR.RESULT_ID "resultId",
  775. AROD.DAYPLAN_NO "dayplanNo",
  776. OO.ORDER_NUMBER "orderNumber",
  777. RG.GATEPOST_NAME "gatepostName",
  778. TLFR.RESULT_OUT_MODE "resultOutMode",
  779. RC.CAPACITY_NUMBER "capacityNumber",
  780. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  781. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  782. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  783. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  784. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  785. LEFT JOIN OMSTRUCK_ORDER OO
  786. ON OO.ORDER_ID = TTR.ORDER_ID
  787. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  788. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  789. LEFT JOIN RMS_CAPACITY RC
  790. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  791. LEFT JOIN RMS_GATEPOST RG
  792. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  793. WHERE OO.ORDER_TYPE = 4
  794. AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  795. <if test="oneDate != null">
  796. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  797. </if>
  798. <if test="startDate != null">
  799. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  800. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  801. </if>
  802. )
  803. <where>
  804. <if test="dayplanNo != null">
  805. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  806. "dayplanNo" like '%${item}%'
  807. </foreach>
  808. </if>
  809. <if test="orderNumber != null">
  810. and
  811. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  812. "orderNumber" like '%${item}%'
  813. </foreach>
  814. </if>
  815. <if test="gatepostName != null">
  816. and
  817. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  818. "gatepostName" like '%${item}%'
  819. </foreach>
  820. </if>
  821. <if test="resultOutMode != null">
  822. and
  823. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  824. "resultOutMode" like '%${item}%'
  825. </foreach>
  826. </if>
  827. <if test="capacityNumber != null">
  828. and
  829. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  830. "dayplanNo" like '%${item}%'
  831. </foreach>
  832. </if>
  833. <if test="resultOutGateTime != null">
  834. and
  835. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  836. "resultOutGateTime" like '%${item}%'
  837. </foreach>
  838. </if>
  839. <if test="resultTruckSnapshotPicture != null">
  840. and
  841. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  842. "resultTruckSnapshotPicture" like '%${item}%'
  843. </foreach>
  844. </if>
  845. </where>
  846. <include refid="orderByOutTime"></include>
  847. </select>
  848. <!-- 查询内转国产矿进口矿 -->
  849. <select id="getImportedDomesticNzEnFactoryResult" resultType="java.util.Map">
  850. select *
  851. from (
  852. select TLFR.RESULT_ID "resultId",
  853. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  854. RM.MATERIAL_NAME "materialName",
  855. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  856. OO.ORDER_NUMBER "orderNumber",
  857. RC.CAPACITY_NUMBER "capacityNumber",
  858. RG.GATEPOST_NAME "gatepostName",
  859. TLFR.RESULT_OUT_MODE "resultOutMode",
  860. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  861. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  862. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  863. left join TMSTRUCK_TOTAL_RESULT TTR
  864. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  865. left join OMSTRUCK_ORDER OO
  866. on OO.ORDER_ID = TTR.ORDER_ID
  867. left join AMS_PURCHASE_ORDER APO
  868. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  869. left join DIL_BATCH DB
  870. on DB.BATCH_ID = APO.BATCH_ID
  871. left join OMSTRUCK_ORDER_MATERIAL OOM
  872. on OOM.ORDER_ID = OO.ORDER_ID
  873. left join RMS_MATERIAL RM
  874. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  875. left join RMS_CAPACITY RC
  876. on RC.CAPACITY_ID = OO.CAPACITY_ID
  877. left join RMS_GATEPOST RG
  878. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  879. where RESULT_OUT_GATE_TIME is not null
  880. and OO.ORDER_TYPE = 9
  881. <if test="oneDate != null">
  882. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  883. </if>
  884. <if test="startDate != null">
  885. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  886. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  887. </if>
  888. )
  889. <where>
  890. <if test="purchaseOrderNo != null">
  891. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  892. "purchaseOrderNo" like '%${item}%'
  893. </foreach>
  894. </if>
  895. <if test="materialName != null">
  896. and
  897. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  898. "materialName" like '%${item}%'
  899. </foreach>
  900. </if>
  901. <if test="resultForeignShipName != null">
  902. and
  903. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  904. "resultForeignShipName" like '%${item}%'
  905. </foreach>
  906. </if>
  907. <if test="orderNumber != null">
  908. and
  909. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  910. "orderNumber" like '%${item}%'
  911. </foreach>
  912. </if>
  913. <if test="capacityNumber != null">
  914. and
  915. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  916. "capacityNumber" like '%${item}%'
  917. </foreach>
  918. </if>
  919. <if test="gatepostName != null">
  920. and
  921. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  922. "gatepostName" like '%${item}%'
  923. </foreach>
  924. </if>
  925. <if test="resultOutMode != null">
  926. and
  927. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  928. "resultOutMode" like '%${item}%'
  929. </foreach>
  930. </if>
  931. <if test="resultOutGateTime != null">
  932. and
  933. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  934. "resultOutGateTime" like '%${item}%'
  935. </foreach>
  936. </if>
  937. <if test="resultTruckSnapshotPicture != null">
  938. and
  939. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  940. "resultTruckSnapshotPicture" like '%${item}%'
  941. </foreach>
  942. </if>
  943. </where>
  944. <include refid="orderByOutTime"></include>
  945. </select>
  946. <!-- 查询内转厂内物资出厂实绩 -->
  947. <select id="getInFactoryOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  948. select *
  949. from (
  950. select TLFR.RESULT_ID "resultId",
  951. OO.ORDER_NUMBER "orderNumber",
  952. RC.CAPACITY_NUMBER "capacityNumber",
  953. RG.GATEPOST_NAME "gatepostName",
  954. TLFR.RESULT_OUT_MODE "resultOutMode",
  955. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  956. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  957. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  958. left join TMSTRUCK_TOTAL_RESULT TTR
  959. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  960. left join OMSTRUCK_ORDER OO
  961. on OO.ORDER_ID = TTR.ORDER_ID
  962. left join RMS_CAPACITY RC
  963. on RC.CAPACITY_ID = OO.CAPACITY_ID
  964. left join RMS_GATEPOST RG
  965. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  966. where RESULT_OUT_GATE_TIME is not null
  967. and OO.ORDER_TYPE = 11
  968. <if test="oneDate != null">
  969. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  970. </if>
  971. <if test="startDate != null">
  972. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  973. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  974. </if>
  975. )
  976. <where>
  977. <if test="orderNumber != null">
  978. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  979. "orderNumber" like '%${item}%'
  980. </foreach>
  981. </if>
  982. <if test="capacityNumber != null">
  983. and
  984. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  985. "capacityNumber" like '%${item}%'
  986. </foreach>
  987. </if>
  988. <if test="gatepostName != null">
  989. and
  990. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  991. "gatepostName" like '%${item}%'
  992. </foreach>
  993. </if>
  994. <if test="resultOutMode != null">
  995. and
  996. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  997. "resultOutMode" like '%${item}%'
  998. </foreach>
  999. </if>
  1000. <if test="resultOutGateTime != null">
  1001. and
  1002. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1003. "resultOutGateTime" like '%${item}%'
  1004. </foreach>
  1005. </if>
  1006. <if test="resultTruckSnapshotPicture != null">
  1007. and
  1008. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1009. "resultTruckSnapshotPicture" like '%${item}%'
  1010. </foreach>
  1011. </if>
  1012. </where>
  1013. <include refid="orderByOutTime"></include>
  1014. </select>
  1015. <select id="getDeliveryOrder" parameterType="java.lang.String" resultType="java.util.Map">
  1016. select
  1017. aso.sale_number "saleNo" ,
  1018. oo.order_number "orderNumber",
  1019. rc.capacity_number "capacityNumber",
  1020. rce.consignee_company_name "consigeeName",
  1021. rcr.carrier_name "carrierName",
  1022. rca.address_province "province",
  1023. rca.address_district "district",
  1024. rca.address_town "town",
  1025. rca.address_delivery_address "deliveryAddress",
  1026. asom.sale_order_consignee "consignee",
  1027. asom.sale_order_consignee_tel "consigneeTel",
  1028. asom.sale_date_of_receipt "receiptDate",
  1029. rsh.SHIPPER_NAME "shippername",
  1030. sysdate "sendDate"
  1031. from omstruck_order oo
  1032. left join
  1033. rms_capacity rc
  1034. on
  1035. rc.capacity_id = oo.capacity_id
  1036. left join
  1037. ams_sale_order_material asom
  1038. on
  1039. asom.sale_order_material_id = oo.order_plan_id
  1040. left join
  1041. ams_sale_order aso
  1042. on
  1043. aso.sale_order_id = asom.sale_order_id
  1044. left join
  1045. rms_consignee rce
  1046. on
  1047. rce.consignee_id = aso.receive_id
  1048. left join
  1049. ams_dispatch_sale_order adso
  1050. on
  1051. adso.sale_order_material_id = asom.sale_order_material_id
  1052. left join
  1053. rms_carrier rcr
  1054. on
  1055. rcr.carrier_id = adso.carrier_id
  1056. left join
  1057. rms_receive_address rca
  1058. on
  1059. rca.address_id = asom.sale_shipping_address_id
  1060. left join RMS_SHIPPER rsh
  1061. on rsh.SHIPPER_ID = aso.SHIPPER_ID
  1062. where oo.order_number =#{orderNumber}
  1063. </select>
  1064. <select id="getDeliveryOrderMaterial" parameterType="java.lang.String" resultType="java.util.LinkedHashMap">
  1065. select
  1066. rm.material_name "materialName",
  1067. rm.material_specification "materialSpe",
  1068. rm.material_model "materialModel",
  1069. oom.order_material_number "materialNumber",
  1070. oom.order_material_weight "materialWeight",
  1071. ruom.unit_of_measure_name "measureName",
  1072. twr.RESULT_NET_WEIGHT "resultWeight"
  1073. from omstruck_order oo
  1074. left join
  1075. omstruck_order_material oom
  1076. on
  1077. oom.order_id = oo.order_id
  1078. left join
  1079. rms_material rm
  1080. on
  1081. rm.material_id = oom.order_material_id
  1082. left join
  1083. rms_unit_of_measure ruom
  1084. on
  1085. ruom.unit_of_measure_id = rm.unit_of_measure_id
  1086. left join
  1087. TMSTRUCK_TOTAL_RESULT ttr
  1088. on ttr.ORDER_ID = oo.ORDER_ID
  1089. left join
  1090. TMSTRUCK_WEIGHT_RESULT twr
  1091. on
  1092. twr.RESULT_TOTAL_ID = ttr.ORDER_ID
  1093. and twr.MATERIAL_ID = oom.MATERIAL_ID
  1094. where oo.order_number = #{orderNumber}
  1095. </select>
  1096. <!--零星物资出厂实绩列表 -->
  1097. <select id="getSporadicLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  1098. select *
  1099. from (
  1100. select distinct TLFR.RESULT_ID "resultId",
  1101. OO.ORDER_NUMBER "orderNumber",
  1102. RC.CAPACITY_NUMBER "capacityNumber",
  1103. RG.GATEPOST_NAME "gatepostName",
  1104. TLFR.RESULT_OUT_MODE "resultOutMode",
  1105. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1106. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  1107. RM.MATERIAL_NAME "materialName",
  1108. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1109. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1110. TWR.RESULT_NET_WEIGHT "netWeight"
  1111. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1112. left join TMSTRUCK_TOTAL_RESULT TTR
  1113. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1114. left join TMSTRUCK_WEIGHT_RESULT TWR
  1115. on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  1116. left join OMSTRUCK_ORDER OO
  1117. on OO.ORDER_ID = TTR.ORDER_ID
  1118. left join OMSTRUCK_ORDER_MATERIAL OOM
  1119. on OO.ORDER_ID=OOM.ORDER_ID
  1120. left join RMS_MATERIAL RM
  1121. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  1122. left join AMSTRUCK_SPORADIC_ORDER ASO
  1123. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  1124. left join RMS_CAPACITY RC
  1125. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1126. left join RMS_GATEPOST RG
  1127. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1128. where RESULT_OUT_GATE_TIME is not null
  1129. <if test="orderTypee != 100">
  1130. AND OO.ORDER_TYPE = #{orderTypee}
  1131. </if>
  1132. <if test="orderTypee == 100">
  1133. AND OO.ORDER_TYPE in (12, 13 ,14,19)
  1134. </if>
  1135. <if test="userId!=null">
  1136. AND ASO.INSERT_USERNAME=#{userId}
  1137. </if>
  1138. <if test="userIds!=null">
  1139. AND ASO.UPDATE_USERNAME=#{userIds}
  1140. </if>
  1141. <if test="con!=null">
  1142. where "orderNumber" like #{con} or "capacityNumber" like #{con}
  1143. or "gatepostName" like #{con} or "materialName" like #{con}
  1144. </if>
  1145. <if test="oneDate != null">
  1146. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  1147. </if>
  1148. <if test="startDate != null">
  1149. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
  1150. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
  1151. </if>
  1152. )
  1153. <where>
  1154. <if test="orderNumber != null">
  1155. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1156. "orderNumber" like '%${item}%'
  1157. </foreach>
  1158. </if>
  1159. <if test="capacityNumber != null">
  1160. and
  1161. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1162. "capacityNumber" like '%${item}%'
  1163. </foreach>
  1164. </if>
  1165. <if test="gatepostName != null">
  1166. and
  1167. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1168. "gatepostName" like '%${item}%'
  1169. </foreach>
  1170. </if>
  1171. <if test="resultOutMode != null">
  1172. and
  1173. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1174. "resultOutMode" like '%${item}%'
  1175. </foreach>
  1176. </if>
  1177. <if test="resultOutGateTime != null">
  1178. and
  1179. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1180. "resultOutGateTime" like '%${item}%'
  1181. </foreach>
  1182. </if>
  1183. <if test="resultTruckSnapshotPicture != null">
  1184. and
  1185. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1186. "resultTruckSnapshotPicture" like '%${item}%'
  1187. </foreach>
  1188. </if>
  1189. </where>
  1190. <include refid="orderByOutTime"></include>
  1191. </select>
  1192. <!-- 根据采购订单ID查询是否为一车多趟 -->
  1193. <select id="getIsMoreTripsStatus" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  1194. select APO.IS_MORE_TRIPS
  1195. from OMSTRUCK_ORDER OO
  1196. left join AMS_PURCHASE_ORDER APO
  1197. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1198. where OO.ORDER_ID = #{orderId}
  1199. </select>
  1200. <select id="getPlanEnable" resultType="java.lang.Integer">
  1201. select aip.plan_eable_status
  1202. from omstruck_order oo
  1203. left join amstruck_inward_plan aip
  1204. on aip.plan_id = oo.order_plan_id
  1205. where oo.order_id = #{orderId}
  1206. </select>
  1207. <select id="getSeq" resultType="java.lang.Integer">
  1208. select oo.order_line_sequence from omstruck_order oo
  1209. where oo.order_id =#{orderId}
  1210. </select>
  1211. </mapper>