TmstruckLeaveFactoryResultMapper.xml 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  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="ResultMapWithBLOBs">
  345. <include refid="select"/>
  346. <include refid="where"/>
  347. </select>
  348. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="ResultMapWithBLOBs">
  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. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  467. OO.ORDER_NUMBER "orderNumber",
  468. RC.CAPACITY_NUMBER "capacityNumber",
  469. RG.GATEPOST_NAME "gatepostName",
  470. TLFR.RESULT_OUT_MODE "resultOutMode",
  471. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  472. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  473. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  474. left join TMSTRUCK_TOTAL_RESULT TTR
  475. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  476. left join OMSTRUCK_ORDER OO
  477. on OO.ORDER_ID = TTR.ORDER_ID
  478. left join AMS_PURCHASE_ORDER APO
  479. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  480. left join DIL_BATCH DB
  481. on DB.BATCH_ID = APO.BATCH_ID
  482. left join OMSTRUCK_ORDER_MATERIAL OOM
  483. on OOM.ORDER_ID = OO.ORDER_ID
  484. left join RMS_MATERIAL RM
  485. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  486. left join RMS_CAPACITY RC
  487. on RC.CAPACITY_ID = OO.CAPACITY_ID
  488. left join RMS_GATEPOST RG
  489. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  490. where RESULT_OUT_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  491. )
  492. <where>
  493. <if test="purchaseOrderNo != null">
  494. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  495. "purchaseOrderNo" like '%${item}%'
  496. </foreach>
  497. </if>
  498. <if test="materialName != null">
  499. and
  500. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  501. "materialName" like '%${item}%'
  502. </foreach>
  503. </if>
  504. <if test="resultForeignShipName != null">
  505. and
  506. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  507. "resultForeignShipName" like '%${item}%'
  508. </foreach>
  509. </if>
  510. <if test="orderNumber != null">
  511. and
  512. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  513. "orderNumber" like '%${item}%'
  514. </foreach>
  515. </if>
  516. <if test="capacityNumber != null">
  517. and
  518. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  519. "capacityNumber" like '%${item}%'
  520. </foreach>
  521. </if>
  522. <if test="gatepostName != null">
  523. and
  524. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  525. "gatepostName" like '%${item}%'
  526. </foreach>
  527. </if>
  528. <if test="resultOutMode != null">
  529. and
  530. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  531. "resultOutMode" like '%${item}%'
  532. </foreach>
  533. </if>
  534. <if test="resultOutGateTime != null">
  535. and
  536. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  537. "resultOutGateTime" like '%${item}%'
  538. </foreach>
  539. </if>
  540. <if test="resultTruckSnapshotPicture != null">
  541. and
  542. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  543. "resultTruckSnapshotPicture" like '%${item}%'
  544. </foreach>
  545. </if>
  546. </where>
  547. <include refid="orderByOutTime"></include>
  548. </select>
  549. <!-- 通过运输订单号查询 路段顺序号是否为 4 :已计皮-->
  550. <select id="selectTransportRoute" parameterType="string" resultType="int">
  551. select ORDER_LINE_SEQUENCE
  552. from OMSTRUCK_ORDER
  553. where ORDER_NUMBER = #{orderNumber}
  554. </select>
  555. <!-- 通过运输订单号查询 出厂门岗ID 和 实绩ID -->
  556. <select id="selectCnAndGnByOrderNumber" parameterType="string" resultType="java.util.Map">
  557. select RL.LINE_END_NODE_ID "lineEndNodeId",
  558. TTR.RESULT_TOTAL_ID "resultTotalId"
  559. from OMSTRUCK_ORDER OO
  560. left join TMSTRUCK_TOTAL_RESULT TTR
  561. on TTR.ORDER_ID = OO.ORDER_ID
  562. left join RMS_LINE RL
  563. on RL.LINE_ID = OO.LINE_ID
  564. where OO.ORDER_NUMBER = #{orderNumber}
  565. </select>
  566. <!-- 通过运输订单号获取实绩ID -->
  567. <select id="selectResultId" parameterType="string" resultType="java.util.Map">
  568. select TLFR.RESULT_ID "resultId",
  569. OO.ORDER_ID "orderId",
  570. OO.ORDER_TYPE "orderTypee",
  571. TTR.RESULT_TOTAL_ID "resultTotalId",
  572. OO.CAPACITY_ID "capacityId"
  573. from OMSTRUCK_ORDER OO
  574. left join TMSTRUCK_TOTAL_RESULT TTR
  575. on OO.ORDER_ID = TTR.ORDER_ID
  576. left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  577. on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  578. where OO.ORDER_NUMBER = #{orderNumber}
  579. </select>
  580. <!--销售物流查询所有的出厂实绩-->
  581. <select id="selectAllLeaveFacatoryForSale" resultType="java.util.Map">
  582. SELECT
  583. *
  584. FROM
  585. (
  586. SELECT
  587. -- 出厂时间
  588. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  589. --出厂抓拍图片
  590. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  591. -- 出厂方式
  592. TLFR.RESULT_OUT_MODE "resultOutMode",
  593. -- 门岗名称
  594. RG.GATEPOST_NAME "gatepostName",
  595. -- 运输订单号
  596. OO.ORDER_NUMBER "orderNumber",
  597. -- 车牌号
  598. RC.CAPACITY_NUMBER "capacityNumber",
  599. -- 运输订单id
  600. OO.ORDER_ID "orderId",
  601. -- 根据订单类型查询销售订单号/发运计划号
  602. ( CASE
  603. -- 运输订单类型等于1的查询销售订单表
  604. WHEN OO.ORDER_TYPE = 1
  605. THEN (
  606. SELECT
  607. -- 销售订单号
  608. ASO.SALE_NUMBER
  609. FROM
  610. -- 销售订单
  611. AMS_SALE_ORDER ASO
  612. WHERE OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  613. )
  614. -- 运输订单类型等于2,3的查询发运计划表
  615. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  616. THEN(
  617. SELECT
  618. -- 发运计划号
  619. ARD.DAYPLAN_NO
  620. -- 发运计划
  621. FROM AMSTRUCK_RAIL_DAYPLAN ARD
  622. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  623. )
  624. END) "saleNum",
  625. --根据订单类型查询发货单位
  626. (CASE
  627. WHEN OO.ORDER_TYPE = 1
  628. THEN (
  629. SELECT
  630. -- 发货单位
  631. RS.SHIPPER_NAME
  632. FROM
  633. --销售订单
  634. AMS_SALE_ORDER ASO --托运人
  635. LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.SHIPPER_ID
  636. WHERE OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  637. )
  638. -- 运输订单类型等于2,3的查询发运计划表
  639. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  640. THEN (
  641. SELECT
  642. --发货单位
  643. RS.SHIPPER_NAME
  644. --发运计划
  645. FROM
  646. AMSTRUCK_RAIL_DAYPLAN ARD
  647. -- 托运人
  648. LEFT JOIN RMS_SHIPPER RS ON ARD.SHIPMENT_UNIT_ID = RS.SHIPPER_ID
  649. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  650. )
  651. END) "shipperName",
  652. --根据订单类型查询收货单位
  653. ( CASE
  654. WHEN OO.ORDER_TYPE = 1
  655. THEN (
  656. SELECT
  657. --收货单位
  658. RS.SUPPLIER_NAME
  659. FROM
  660. -- 销售订单
  661. AMS_SALE_ORDER ASO
  662. -- 托运人
  663. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  664. WHERE OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  665. ) -- 运输订单类型等于2,3的查询发运计划表
  666. WHEN OO.ORDER_TYPE IN ( 2, 3 )
  667. THEN (
  668. SELECT
  669. --发货单位
  670. RS.SUPPLIER_NAME --发运计划
  671. FROM
  672. AMSTRUCK_RAIL_DAYPLAN ARD
  673. --托运人
  674. LEFT JOIN RMS_SUPPLIER RS ON ARD.SHIPMENT_UNIT_ID = RS.SUPPLIER_ID
  675. WHERE OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
  676. )
  677. END) "supplierName"
  678. FROM
  679. -- 出厂实绩
  680. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  681. -- 门岗
  682. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  683. -- 总实绩
  684. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  685. -- 运输订单
  686. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  687. -- 运力信息
  688. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  689. WHERE
  690. -- 判断出厂实绩的出厂时间不为空
  691. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  692. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  693. AND OO.ORDER_TYPE IN ( 1, 2, 3 )
  694. )
  695. <where>
  696. <if test="resultOutGateTime != null">
  697. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  698. "resultOutGateTime" like '%${item}%'
  699. </foreach>
  700. </if>
  701. <if test="resultTruckSnapshotPicture != null">
  702. and
  703. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  704. "resultTruckSnapshotPicture" like '%${item}%'
  705. </foreach>
  706. </if>
  707. <if test="resultOutMode != null">
  708. and
  709. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  710. "resultOutMode" like '%${item}%'
  711. </foreach>
  712. </if>
  713. <if test="gatepostName != null">
  714. and
  715. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  716. "gatepostName" like '%${item}%'
  717. </foreach>
  718. </if>
  719. <if test="orderNumber != null">
  720. and
  721. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  722. "orderNumber" like '%${item}%'
  723. </foreach>
  724. </if>
  725. <if test="capacityNumber != null">
  726. and
  727. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  728. "capacityNumber" like '%${item}%'
  729. </foreach>
  730. </if>
  731. <if test="saleNum != null">
  732. and
  733. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  734. "saleNum" like '%${item}%'
  735. </foreach>
  736. </if>
  737. <if test="shipperName != null">
  738. and
  739. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  740. "shipperName" like '%${item}%'
  741. </foreach>
  742. </if>
  743. <if test="supplierName != null">
  744. and
  745. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  746. "supplierName" like '%${item}%'
  747. </foreach>
  748. </if>
  749. </where>
  750. <include refid="orderByOutTime"></include>
  751. </select>
  752. <!-- 通过总实绩Id 查询出厂实绩ID -->
  753. <select id="getResultIdByTotalId" parameterType="int" resultType="java.math.BigDecimal">
  754. select TLFR.RESULT_ID
  755. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  756. where TLFR.RESULT_TOTAL_ID = #{resultTotalId}
  757. </select>
  758. <select id="getTruckFactoryResult" resultType="java.util.Map">
  759. SELECT * from(
  760. SELECT
  761. -- 出厂时间
  762. to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
  763. --出厂抓拍图片
  764. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
  765. --出厂方式
  766. TLFR.RESULT_OUT_MODE "resultOutMode",
  767. --门岗名称
  768. RG.GATEPOST_NAME "gatepostName",
  769. -- 运输订单号
  770. OO.ORDER_NUMBER "orderNumber",
  771. -- 车牌号
  772. RC.CAPACITY_NUMBER "capacityNumber",
  773. -- 运输订单id
  774. OO.ORDER_ID "orderId",
  775. -- 订单类型
  776. OO.ORDER_TYPE "orderType",
  777. -- 销售订单号
  778. ASO.SALE_NUMBER "saleNum",
  779. -- 收货地址
  780. RRA.ADDRESS_DELIVERY_ADDRESS "receiveAddress",
  781. -- 收货单位
  782. RS.SUPPLIER_NAME "supplierName" ,
  783. -- 发货单位
  784. RS2.SHIPPER_NAME "shipperName"
  785. FROM
  786. -- 出厂实绩
  787. TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  788. -- 总实绩
  789. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  790. -- 运输订单
  791. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  792. -- 销售订单信息
  793. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  794. -- 托运人
  795. LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
  796. -- 门岗
  797. LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
  798. -- 运力信息
  799. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  800. -- 销售订单中间表
  801. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
  802. -- 收货地址
  803. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID =RRA.ADDRESS_ID
  804. -- 收货单位
  805. LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
  806. WHERE
  807. -- 判断出厂实绩的出厂时间不为空
  808. TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  809. -- 并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
  810. AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
  811. )
  812. </select>
  813. <!-- 查询内转钢材到异地库出厂实绩 -->
  814. <select id="selectSteelNzLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
  815. SELECT
  816. *
  817. FROM (
  818. SELECT
  819. OO.ORDER_ID "orderId",
  820. TLFR.RESULT_ID "resultId",
  821. AROD.DAYPLAN_NO "dayplanNo",
  822. OO.ORDER_NUMBER "orderNumber",
  823. RG.GATEPOST_NAME "gatepostName",
  824. TLFR.RESULT_OUT_MODE "resultOutMode",
  825. RC.CAPACITY_NUMBER "capacityNumber",
  826. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  827. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  828. FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  829. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  830. ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  831. LEFT JOIN OMSTRUCK_ORDER OO
  832. ON OO.ORDER_ID = TTR.ORDER_ID
  833. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  834. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  835. LEFT JOIN RMS_CAPACITY RC
  836. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  837. LEFT JOIN RMS_GATEPOST RG
  838. ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
  839. WHERE OO.ORDER_TYPE = 4
  840. AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
  841. )
  842. <where>
  843. <if test="dayplanNo != null">
  844. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  845. "dayplanNo" like '%${item}%'
  846. </foreach>
  847. </if>
  848. <if test="orderNumber != null">
  849. and
  850. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  851. "orderNumber" like '%${item}%'
  852. </foreach>
  853. </if>
  854. <if test="gatepostName != null">
  855. and
  856. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  857. "gatepostName" like '%${item}%'
  858. </foreach>
  859. </if>
  860. <if test="resultOutMode != null">
  861. and
  862. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  863. "resultOutMode" like '%${item}%'
  864. </foreach>
  865. </if>
  866. <if test="capacityNumber != null">
  867. and
  868. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  869. "dayplanNo" like '%${item}%'
  870. </foreach>
  871. </if>
  872. <if test="resultOutGateTime != null">
  873. and
  874. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  875. "resultOutGateTime" like '%${item}%'
  876. </foreach>
  877. </if>
  878. <if test="resultTruckSnapshotPicture != null">
  879. and
  880. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  881. "resultTruckSnapshotPicture" like '%${item}%'
  882. </foreach>
  883. </if>
  884. </where>
  885. <include refid="orderByOutTime"></include>
  886. </select>
  887. <!-- 查询内转国产矿进口矿 -->
  888. <select id="getImportedDomesticNzEnFactoryResult" resultType="java.util.Map">
  889. select *
  890. from (
  891. select TLFR.RESULT_ID "resultId",
  892. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  893. RM.MATERIAL_NAME "materialName",
  894. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  895. OO.ORDER_NUMBER "orderNumber",
  896. RC.CAPACITY_NUMBER "capacityNumber",
  897. RG.GATEPOST_NAME "gatepostName",
  898. TLFR.RESULT_OUT_MODE "resultOutMode",
  899. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  900. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  901. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  902. left join TMSTRUCK_TOTAL_RESULT TTR
  903. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  904. left join OMSTRUCK_ORDER OO
  905. on OO.ORDER_ID = TTR.ORDER_ID
  906. left join AMS_PURCHASE_ORDER APO
  907. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  908. left join DIL_BATCH DB
  909. on DB.BATCH_ID = APO.BATCH_ID
  910. left join OMSTRUCK_ORDER_MATERIAL OOM
  911. on OOM.ORDER_ID = OO.ORDER_ID
  912. left join RMS_MATERIAL RM
  913. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  914. left join RMS_CAPACITY RC
  915. on RC.CAPACITY_ID = OO.CAPACITY_ID
  916. left join RMS_GATEPOST RG
  917. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  918. where RESULT_OUT_GATE_TIME is not null
  919. and OO.ORDER_TYPE = 9
  920. )
  921. <where>
  922. <if test="purchaseOrderNo != null">
  923. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  924. "purchaseOrderNo" like '%${item}%'
  925. </foreach>
  926. </if>
  927. <if test="materialName != null">
  928. and
  929. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  930. "materialName" like '%${item}%'
  931. </foreach>
  932. </if>
  933. <if test="resultForeignShipName != null">
  934. and
  935. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  936. "resultForeignShipName" like '%${item}%'
  937. </foreach>
  938. </if>
  939. <if test="orderNumber != null">
  940. and
  941. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  942. "orderNumber" like '%${item}%'
  943. </foreach>
  944. </if>
  945. <if test="capacityNumber != null">
  946. and
  947. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  948. "capacityNumber" like '%${item}%'
  949. </foreach>
  950. </if>
  951. <if test="gatepostName != null">
  952. and
  953. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  954. "gatepostName" like '%${item}%'
  955. </foreach>
  956. </if>
  957. <if test="resultOutMode != null">
  958. and
  959. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  960. "resultOutMode" like '%${item}%'
  961. </foreach>
  962. </if>
  963. <if test="resultOutGateTime != null">
  964. and
  965. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  966. "resultOutGateTime" like '%${item}%'
  967. </foreach>
  968. </if>
  969. <if test="resultTruckSnapshotPicture != null">
  970. and
  971. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  972. "resultTruckSnapshotPicture" like '%${item}%'
  973. </foreach>
  974. </if>
  975. </where>
  976. <include refid="orderByOutTime"></include>
  977. </select>
  978. <!-- 查询内转厂内物资出厂实绩 -->
  979. <select id="getInFactoryOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  980. select *
  981. from (
  982. select TLFR.RESULT_ID "resultId",
  983. OO.ORDER_NUMBER "orderNumber",
  984. RC.CAPACITY_NUMBER "capacityNumber",
  985. RG.GATEPOST_NAME "gatepostName",
  986. TLFR.RESULT_OUT_MODE "resultOutMode",
  987. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  988. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  989. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  990. left join TMSTRUCK_TOTAL_RESULT TTR
  991. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  992. left join OMSTRUCK_ORDER OO
  993. on OO.ORDER_ID = TTR.ORDER_ID
  994. left join RMS_CAPACITY RC
  995. on RC.CAPACITY_ID = OO.CAPACITY_ID
  996. left join RMS_GATEPOST RG
  997. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  998. where RESULT_OUT_GATE_TIME is not null
  999. and OO.ORDER_TYPE = 11
  1000. )
  1001. <where>
  1002. <if test="orderNumber != null">
  1003. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1004. "orderNumber" like '%${item}%'
  1005. </foreach>
  1006. </if>
  1007. <if test="capacityNumber != null">
  1008. and
  1009. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1010. "capacityNumber" like '%${item}%'
  1011. </foreach>
  1012. </if>
  1013. <if test="gatepostName != null">
  1014. and
  1015. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1016. "gatepostName" like '%${item}%'
  1017. </foreach>
  1018. </if>
  1019. <if test="resultOutMode != null">
  1020. and
  1021. <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
  1022. "resultOutMode" like '%${item}%'
  1023. </foreach>
  1024. </if>
  1025. <if test="resultOutGateTime != null">
  1026. and
  1027. <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
  1028. "resultOutGateTime" like '%${item}%'
  1029. </foreach>
  1030. </if>
  1031. <if test="resultTruckSnapshotPicture != null">
  1032. and
  1033. <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
  1034. "resultTruckSnapshotPicture" like '%${item}%'
  1035. </foreach>
  1036. </if>
  1037. </where>
  1038. <include refid="orderByOutTime"></include>
  1039. </select>
  1040. </mapper>