TmsshipTotalResultMapper.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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.TmsshipTotalResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmsshipTotalResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
  6. <result column="ORDER_ID" jdbcType="DECIMAL" property="orderId"/>
  7. <result column="RESULT_DURATION" jdbcType="DECIMAL" property="resultDuration"/>
  8. <result column="STANDARD_DATA_ID" jdbcType="DECIMAL" property="standardDataId"/>
  9. <result column="RESULT_OUTLIER" jdbcType="DECIMAL" property="resultOutlier"/>
  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. </resultMap>
  16. <sql id="columns">
  17. RESULT_ID, ORDER_ID, RESULT_DURATION, STANDARD_DATA_ID, RESULT_OUTLIER, INSERT_USERNAME,
  18. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
  19. </sql>
  20. <sql id="columns_alias">
  21. t.RESULT_ID, t.ORDER_ID, t.RESULT_DURATION, t.STANDARD_DATA_ID, t.RESULT_OUTLIER,
  22. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  23. </sql>
  24. <sql id="select">
  25. SELECT
  26. <include refid="columns"/>
  27. FROM TMSSHIP_TOTAL_RESULT
  28. </sql>
  29. <sql id="select_alias">
  30. SELECT
  31. <include refid="columns_alias"/>
  32. FROM TMSSHIP_TOTAL_RESULT t
  33. </sql>
  34. <sql id="where">
  35. <where>
  36. <if test="resultId != null">
  37. and RESULT_ID = #{resultId}
  38. </if>
  39. <if test="orderId != null">
  40. and ORDER_ID = #{orderId}
  41. </if>
  42. <if test="resultDuration != null">
  43. and RESULT_DURATION = #{resultDuration}
  44. </if>
  45. <if test="standardDataId != null">
  46. and STANDARD_DATA_ID = #{standardDataId}
  47. </if>
  48. <if test="resultOutlier != null">
  49. and RESULT_OUTLIER = #{resultOutlier}
  50. </if>
  51. <if test="insertUsername != null and insertUsername != ''">
  52. and INSERT_USERNAME = #{insertUsername}
  53. </if>
  54. <if test="insertTime != null">
  55. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  56. </if>
  57. <if test="updateUsername != null and updateUsername != ''">
  58. and UPDATE_USERNAME = #{updateUsername}
  59. </if>
  60. <if test="updateTime != null">
  61. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  62. </if>
  63. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  64. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  65. </if>
  66. </where>
  67. </sql>
  68. <sql id="whereLike">
  69. <where>
  70. <if test="resultId != null">
  71. and RESULT_ID = #{resultId}
  72. </if>
  73. <if test="orderId != null">
  74. and ORDER_ID = #{orderId}
  75. </if>
  76. <if test="resultDuration != null">
  77. and RESULT_DURATION = #{resultDuration}
  78. </if>
  79. <if test="standardDataId != null">
  80. and STANDARD_DATA_ID = #{standardDataId}
  81. </if>
  82. <if test="resultOutlier != null">
  83. and RESULT_OUTLIER = #{resultOutlier}
  84. </if>
  85. <if test="insertUsername != null and insertUsername != ''">
  86. and INSERT_USERNAME LIKE '%${insertUsername}%'
  87. </if>
  88. <if test="insertTime != null">
  89. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  90. </if>
  91. <if test="updateUsername != null and updateUsername != ''">
  92. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  93. </if>
  94. <if test="updateTime != null">
  95. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  96. </if>
  97. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  98. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  99. </if>
  100. </where>
  101. </sql>
  102. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  103. delete
  104. from TMSSHIP_TOTAL_RESULT
  105. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  106. </delete>
  107. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  108. delete from TMSSHIP_TOTAL_RESULT
  109. where 1!=1
  110. <if test="orderId != null">
  111. or ORDER_ID = #{orderId}
  112. </if>
  113. <if test="resultDuration != null">
  114. or RESULT_DURATION = #{resultDuration}
  115. </if>
  116. <if test="standardDataId != null">
  117. or STANDARD_DATA_ID = #{standardDataId}
  118. </if>
  119. <if test="resultOutlier != null">
  120. or RESULT_OUTLIER = #{resultOutlier}
  121. </if>
  122. <if test="insertUsername != null and insertUsername != ''">
  123. or INSERT_USERNAME = #{insertUsername}
  124. </if>
  125. <if test="insertTime != null">
  126. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  127. </if>
  128. <if test="updateUsername != null and updateUsername != ''">
  129. or UPDATE_USERNAME = #{updateUsername}
  130. </if>
  131. <if test="updateTime != null">
  132. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  133. </if>
  134. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  135. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  136. </if>
  137. </delete>
  138. <insert id="insert" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
  139. insert into TMSSHIP_TOTAL_RESULT (RESULT_ID, ORDER_ID, RESULT_DURATION,
  140. STANDARD_DATA_ID, RESULT_OUTLIER, INSERT_USERNAME,
  141. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  142. INSERT_UPDATE_REMARK)
  143. values (#{resultId,jdbcType=DECIMAL}, #{orderId,jdbcType=DECIMAL}, #{resultDuration,jdbcType=DECIMAL},
  144. #{standardDataId,jdbcType=DECIMAL}, #{resultOutlier,jdbcType=DECIMAL},
  145. #{insertUsername,jdbcType=VARCHAR},
  146. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  147. #{insertUpdateRemark,jdbcType=VARCHAR})
  148. </insert>
  149. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
  150. insert into TMSSHIP_TOTAL_RESULT
  151. <trim prefix="(" suffix=")" suffixOverrides=",">
  152. <if test="resultId != null">
  153. RESULT_ID,
  154. </if>
  155. <if test="orderId != null">
  156. ORDER_ID,
  157. </if>
  158. <if test="resultDuration != null">
  159. RESULT_DURATION,
  160. </if>
  161. <if test="standardDataId != null">
  162. STANDARD_DATA_ID,
  163. </if>
  164. <if test="resultOutlier != null">
  165. RESULT_OUTLIER,
  166. </if>
  167. <if test="insertUsername != null">
  168. INSERT_USERNAME,
  169. </if>
  170. <if test="insertTime != null">
  171. INSERT_TIME,
  172. </if>
  173. <if test="updateUsername != null">
  174. UPDATE_USERNAME,
  175. </if>
  176. <if test="updateTime != null">
  177. UPDATE_TIME,
  178. </if>
  179. <if test="insertUpdateRemark != null">
  180. INSERT_UPDATE_REMARK,
  181. </if>
  182. </trim>
  183. <trim prefix="values (" suffix=")" suffixOverrides=",">
  184. <if test="resultId != null">
  185. #{resultId,jdbcType=DECIMAL},
  186. </if>
  187. <if test="orderId != null">
  188. #{orderId,jdbcType=DECIMAL},
  189. </if>
  190. <if test="resultDuration != null">
  191. #{resultDuration,jdbcType=DECIMAL},
  192. </if>
  193. <if test="standardDataId != null">
  194. #{standardDataId,jdbcType=DECIMAL},
  195. </if>
  196. <if test="resultOutlier != null">
  197. #{resultOutlier,jdbcType=DECIMAL},
  198. </if>
  199. <if test="insertUsername != null">
  200. #{insertUsername,jdbcType=VARCHAR},
  201. </if>
  202. <if test="insertTime != null">
  203. #{insertTime,jdbcType=TIMESTAMP},
  204. </if>
  205. <if test="updateUsername != null">
  206. #{updateUsername,jdbcType=VARCHAR},
  207. </if>
  208. <if test="updateTime != null">
  209. #{updateTime,jdbcType=TIMESTAMP},
  210. </if>
  211. <if test="insertUpdateRemark != null">
  212. #{insertUpdateRemark,jdbcType=VARCHAR},
  213. </if>
  214. </trim>
  215. </insert>
  216. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
  217. update TMSSHIP_TOTAL_RESULT
  218. set ORDER_ID = #{orderId,jdbcType=DECIMAL},
  219. RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
  220. STANDARD_DATA_ID = #{standardDataId,jdbcType=DECIMAL},
  221. RESULT_OUTLIER = #{resultOutlier,jdbcType=DECIMAL},
  222. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  223. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  224. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  225. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  226. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  227. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  228. </update>
  229. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
  230. update TMSSHIP_TOTAL_RESULT
  231. <set>
  232. <if test="orderId != null">
  233. ORDER_ID = #{orderId,jdbcType=DECIMAL},
  234. </if>
  235. <if test="resultDuration != null">
  236. RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
  237. </if>
  238. <if test="standardDataId != null">
  239. STANDARD_DATA_ID = #{standardDataId,jdbcType=DECIMAL},
  240. </if>
  241. <if test="resultOutlier != null">
  242. RESULT_OUTLIER = #{resultOutlier,jdbcType=DECIMAL},
  243. </if>
  244. <if test="insertUsername != null">
  245. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  246. </if>
  247. <if test="insertTime != null">
  248. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  249. </if>
  250. <if test="updateUsername != null">
  251. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  252. </if>
  253. <if test="updateTime != null">
  254. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  255. </if>
  256. <if test="insertUpdateRemark != null">
  257. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  258. </if>
  259. </set>
  260. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  261. </update>
  262. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  263. <include refid="select"/>
  264. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  265. </select>
  266. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  267. <include refid="select"/>
  268. <include refid="where"/>
  269. </select>
  270. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  271. <include refid="select"/>
  272. <include refid="whereLike"/>
  273. </select>
  274. <insert id="batchInsert" parameterType="java.util.List">
  275. insert into TMSSHIP_TOTAL_RESULT
  276. (RESULT_ID,
  277. ORDER_ID, RESULT_DURATION, STANDARD_DATA_ID,
  278. RESULT_OUTLIER, INSERT_USERNAME,
  279. INSERT_TIME, UPDATE_USERNAME,
  280. UPDATE_TIME, INSERT_UPDATE_REMARK
  281. )
  282. ( <foreach collection="list" item="item" separator="union all">
  283. select
  284. #{item.resultId,jdbcType=DECIMAL},
  285. #{item.orderId,jdbcType=DECIMAL}, #{item.resultDuration,jdbcType=DECIMAL},
  286. #{item.standardDataId,jdbcType=DECIMAL},
  287. #{item.resultOutlier,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  288. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  289. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
  290. from dual
  291. </foreach> )
  292. </insert>
  293. <update id="batchUpdate" parameterType="java.util.List">
  294. update TMSSHIP_TOTAL_RESULT
  295. set
  296. RESULT_ID=
  297. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  298. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  299. </foreach>
  300. ,ORDER_ID=
  301. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  302. when #{item.resultId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
  303. </foreach>
  304. ,RESULT_DURATION=
  305. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  306. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDuration,jdbcType=DECIMAL}
  307. </foreach>
  308. ,STANDARD_DATA_ID=
  309. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  310. when #{item.resultId,jdbcType=DECIMAL} then #{item.standardDataId,jdbcType=DECIMAL}
  311. </foreach>
  312. ,RESULT_OUTLIER=
  313. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  314. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutlier,jdbcType=DECIMAL}
  315. </foreach>
  316. ,INSERT_USERNAME=
  317. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  318. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  319. </foreach>
  320. ,INSERT_TIME=
  321. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  322. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  323. </foreach>
  324. ,UPDATE_USERNAME=
  325. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  326. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  327. </foreach>
  328. ,UPDATE_TIME=
  329. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  330. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  331. </foreach>
  332. ,INSERT_UPDATE_REMARK=
  333. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  334. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  335. </foreach>
  336. where RESULT_ID in
  337. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  338. #{item.resultId,jdbcType=DECIMAL}
  339. </foreach>
  340. </update>
  341. <delete id="batchDelete" parameterType="java.util.List">
  342. delete from TMSSHIP_TOTAL_RESULT
  343. where RESULT_ID in
  344. <foreach collection="list" item="id" open="(" close=")" separator=",">
  345. #{id}
  346. </foreach>
  347. </delete>
  348. <!-- 友情提示!!!-->
  349. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  350. <select id="selectMaxId" resultType="DECIMAL">
  351. SELECT MAX(RESULT_ID) + 1
  352. FROM TMSSHIP_TOTAL_RESULT
  353. </select>
  354. <select id="selectResultTotalId" resultType="DECIMAL">
  355. SELECT RESULT_ID
  356. FROM TMSSHIP_TOTAL_RESULT
  357. WHERE ORDER_ID = #{orderId}
  358. </select>
  359. <sql id="orderByInsertTime">
  360. <if test="orderField != null and orderField != ''">
  361. order by "${orderField}"
  362. <if test="orderType != null and orderType != ''">
  363. ${orderType}
  364. </if>
  365. </if>
  366. <if test="orderField == null ">
  367. order by "insertTime" desc
  368. </if>
  369. </sql>
  370. <select id="selectOrderList" resultType="java.util.Map">
  371. select * from (
  372. SELECT DISTINCT ttr.ORDER_ID as "orderId",
  373. ttr.INSERT_TIME as "insertTime",
  374. rm.MATERIAL_NAME as "materialName",
  375. db.RESULT_FOREIGN_SHIP_NAME as "foreignShipName",
  376. rc.CAPACITY_NUMBER as "capacityName",
  377. rsh.SHIPPER_ABBREVIATION as "shipperAbbreviation",
  378. rsu.CARRIER_NAME as "supplierAbbreviation",
  379. pier.PIER_NAME as "groupName",
  380. tlsr.RESULT_LOAD_SHIP_DATE as "resultLoadShipDate",
  381. rps.PORT_NAME as "startPortName",
  382. rpe.PORT_NAME as "arrivePortName",
  383. tlsr.RESULT_ARRIVAL_PORT_TIME as "arriveTime",
  384. tlsr.RESULT_OUT_PORT_TIME as "liveTime",
  385. oic.INSTRUCTION_PLANNED_LOADING as "planWeight",
  386. tlsr.RESULT_ACTUAL_INSTALLATIONS as "realWeight",
  387. tlsr.INSERT_UPDATE_REMARK as "resultMemo"
  388. FROM TMSSHIP_TOTAL_RESULT ttr
  389. LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oic
  390. ON oic.INSTRUCTIONS_CAPACITY_ID = ttr.ORDER_ID
  391. LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
  392. ON osi.SHIPMENT_INSTRUCTIONS_ID = oic.INSTRUCTIONS_ID
  393. LEFT JOIN DIL_BATCH db
  394. ON osi.BATCH_ID = db.BATCH_ID
  395. LEFT JOIN RMS_MATERIAL rm
  396. ON db.MATERIAL_ID = rm.MATERIAL_ID
  397. LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ada
  398. on osi.BATCH_ID = ada.BATCH_ID
  399. LEFT JOIN AMSSHIP_DELIVERY_NOTICE adn
  400. on adn.BATCH_ID = ada.BATCH_ID
  401. LEFT JOIN AMSSHIP_CARGO_TRANSFER_RESULT actr
  402. ON actr.BATCH_ID = adn.BATCH_ID
  403. LEFT JOIN RMS_SHIPPER rsh
  404. ON adn.REQUESTER_GROUP_ID = rsh.SHIPPER_ID
  405. LEFT JOIN RMS_CARRIER rsu
  406. ON adn.CARRIER_ID = rsu.CARRIER_ID
  407. LEFT JOIN RMS_PIER pier
  408. ON pier.PIER_ID = actr.GROUP_ID
  409. LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr
  410. ON ttr.RESULT_ID = tlsr.TOTAL_RESULT_ID
  411. LEFT JOIN RMS_PORT rps
  412. ON tlsr.LOCATION_START_PORT_ID = rps.PORT_ID
  413. LEFT JOIN RMS_PORT rpe
  414. ON tlsr.ARRIVAL_PORT_ID = rpe.PORT_ID
  415. LEFT JOIN RMS_CAPACITY rc
  416. ON rc.CAPACITY_ID = oic.CAPACITY_ID
  417. )
  418. <where>
  419. <if test="materialName != null">
  420. and
  421. <foreach collection="materialName" item="item" open="(" separator="," close=")">
  422. "materialName" in #{item}
  423. </foreach>
  424. </if>
  425. <if test="foreignShipName != null">
  426. and
  427. <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
  428. "foreignShipName" in #{item}
  429. </foreach>
  430. </if>
  431. <if test="capacityName != null">
  432. and
  433. <foreach collection="capacityName" item="item" open="(" separator="," close=")">
  434. "capacityName" in #{item}
  435. </foreach>
  436. </if>
  437. <if test="shipperAbbreviation != null">
  438. and
  439. <foreach collection="shipperAbbreviation" item="item" open="(" separator="," close=")">
  440. "shipperAbbreviation" in #{item}
  441. </foreach>
  442. </if>
  443. <if test="supplierAbbreviation != null">
  444. and
  445. <foreach collection="supplierAbbreviation" item="item" open="(" separator="," close=")">
  446. "supplierAbbreviation" in #{item}
  447. </foreach>
  448. </if>
  449. <if test="groupName != null">
  450. and
  451. <foreach collection="groupName" item="item" open="(" separator="," close=")">
  452. "groupName" in #{item}
  453. </foreach>
  454. </if>
  455. <if test="resultLoadShipDate != null">
  456. and
  457. <foreach collection="resultLoadShipDate" item="item" open="(" separator="," close=")">
  458. "resultLoadShipDate" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  459. </foreach>
  460. </if>
  461. <if test="startPortName != null">
  462. and
  463. <foreach collection="startPortName" item="item" open="(" separator="," close=")">
  464. "startPortName" in #{item}
  465. </foreach>
  466. </if>
  467. <if test="arrivePortName != null">
  468. and
  469. <foreach collection="arrivePortName" item="item" open="(" separator="," close=")">
  470. "arrivePortName" in #{item}
  471. </foreach>
  472. </if>
  473. <if test="arriveTime != null">
  474. and
  475. <foreach collection="arriveTime" item="item" open="(" separator="," close=")">
  476. "arriveTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  477. </foreach>
  478. </if>
  479. <if test="liveTime != null">
  480. and
  481. <foreach collection="liveTime" item="item" open="(" separator="," close=")">
  482. "liveTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  483. </foreach>
  484. </if>
  485. <if test="planWeight != null">
  486. and
  487. <foreach collection="planWeight" item="item" open="(" separator="," close=")">
  488. "planWeight" in #{item}
  489. </foreach>
  490. </if>
  491. <if test="realWeight != null">
  492. and
  493. <foreach collection="realWeight" item="item" open="(" separator="," close=")">
  494. "realWeight" in #{item}
  495. </foreach>
  496. </if>
  497. <if test="resultMemo != null">
  498. and
  499. <foreach collection="resultMemo" item="item" open="(" separator="," close=")">
  500. "resultMemo" in #{item}
  501. </foreach>
  502. </if>
  503. </where>
  504. <include refid="orderByInsertTime"></include>
  505. </select>
  506. <select id="getCapacity" resultType="java.util.Map">
  507. SELECT * FROM(
  508. SELECT db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
  509. rm.MATERIAL_NAME as "materialName",
  510. rc.CAPACITY_NUMBER as "capacityNumber",
  511. oic.INSTRUCTIONS_CAPACITY_ID as "orderId",
  512. db.BATCH_ID as "batchId"
  513. FROM OMSSHIP_INSTRUCTIONS_CAPACITY oic
  514. LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
  515. ON oic.INSTRUCTIONS_ID = osi.SHIPMENT_INSTRUCTIONS_ID
  516. LEFT JOIN DIL_BATCH db
  517. ON db.BATCH_ID = osi.BATCH_ID
  518. LEFT JOIN RMS_MATERIAL rm
  519. ON rm.MATERIAL_ID = db.MATERIAL_ID
  520. LEFT JOIN RMS_CAPACITY rc
  521. ON rc.CAPACITY_ID = oic.CAPACITY_ID
  522. )
  523. <where>
  524. <if test="resultForeignShipName != null">
  525. and
  526. <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
  527. "resultForeignShipName" in #{item}
  528. </foreach>
  529. </if>
  530. <if test="materialName != null">
  531. and
  532. <foreach collection="materialName" item="item" open="(" separator="," close=")">
  533. "materialName" in #{item}
  534. </foreach>
  535. </if>
  536. <if test="capacityNumber != null">
  537. and
  538. <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
  539. "capacityNumber" in #{item}
  540. </foreach>
  541. </if>
  542. </where>
  543. </select>
  544. </mapper>