OmsshipShipmentInstructionsMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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.OmsshipShipmentInstructionsMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmsshipShipmentInstructions">
  5. <id column="SHIPMENT_INSTRUCTIONS_ID" jdbcType="DECIMAL" property="shipmentInstructionsId"/>
  6. <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId"/>
  7. <result column="RECIPIENT_CARRIER_ID" jdbcType="DECIMAL" property="recipientCarrierId"/>
  8. <result column="PORT_CARRIER_ID" jdbcType="DECIMAL" property="portCarrierId"/>
  9. <result column="INSTRUCTIONS_TOTAL_TONNAGE" jdbcType="DECIMAL" property="instructionsTotalTonnage"/>
  10. <result column="INSTRUCTION_TIME" jdbcType="TIMESTAMP" property="instructionTime"/>
  11. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
  12. <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime"/>
  13. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  14. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  15. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  16. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  18. <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
  19. <result column="INSTRUCTION_ISSUE_STATUS" jdbcType="VARCHAR" property="instructionIssueStatus"/>
  20. </resultMap>
  21. <sql id="columns">
  22. SHIPMENT_INSTRUCTIONS_ID, BATCH_ID, RECIPIENT_CARRIER_ID, PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
  23. INSTRUCTION_TIME, DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  24. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, INSTRUCTION_ISSUE_STATUS
  25. </sql>
  26. <sql id="columns_alias">
  27. t.SHIPMENT_INSTRUCTIONS_ID, t.BATCH_ID, t.RECIPIENT_CARRIER_ID, t.PORT_CARRIER_ID,
  28. t.INSTRUCTIONS_TOTAL_TONNAGE, t.INSTRUCTION_TIME, t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME,
  29. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
  30. t.INSTRUCTION_ISSUE_STATUS
  31. </sql>
  32. <sql id="select">
  33. SELECT
  34. <include refid="columns"/>
  35. FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
  36. </sql>
  37. <sql id="select_alias">
  38. SELECT
  39. <include refid="columns_alias"/>
  40. FROM OMSSHIP_SHIPMENT_INSTRUCTIONS t
  41. </sql>
  42. <sql id="where">
  43. <where>
  44. <if test="shipmentInstructionsId != null">
  45. and SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
  46. </if>
  47. <if test="batchId != null">
  48. and BATCH_ID = #{batchId}
  49. </if>
  50. <if test="recipientCarrierId != null">
  51. and RECIPIENT_CARRIER_ID = #{recipientCarrierId}
  52. </if>
  53. <if test="portCarrierId != null">
  54. and PORT_CARRIER_ID = #{portCarrierId}
  55. </if>
  56. <if test="instructionsTotalTonnage != null">
  57. and INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
  58. </if>
  59. <if test="instructionTime != null">
  60. and TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = #{instructionTime}
  61. </if>
  62. <if test="deleteName != null and deleteName != ''">
  63. and DELETE_NAME = #{deleteName}
  64. </if>
  65. <if test="deleteTime != null and deleteTime != ''">
  66. and DELETE_TIME = #{deleteTime}
  67. </if>
  68. <if test="insertUsername != null and insertUsername != ''">
  69. and INSERT_USERNAME = #{insertUsername}
  70. </if>
  71. <if test="insertTime != null">
  72. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  73. </if>
  74. <if test="updateUsername != null and updateUsername != ''">
  75. and UPDATE_USERNAME = #{updateUsername}
  76. </if>
  77. <if test="updateTime != null">
  78. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  79. </if>
  80. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  81. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  82. </if>
  83. <if test="deleted != null">
  84. and DELETED = #{deleted}
  85. </if>
  86. <if test="instructionIssueStatus != null and instructionIssueStatus != ''">
  87. and INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus}
  88. </if>
  89. </where>
  90. </sql>
  91. <sql id="whereLike">
  92. <where>
  93. <if test="shipmentInstructionsId != null">
  94. and SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
  95. </if>
  96. <if test="batchId != null">
  97. and BATCH_ID = #{batchId}
  98. </if>
  99. <if test="recipientCarrierId != null">
  100. and RECIPIENT_CARRIER_ID = #{recipientCarrierId}
  101. </if>
  102. <if test="portCarrierId != null">
  103. and PORT_CARRIER_ID = #{portCarrierId}
  104. </if>
  105. <if test="instructionsTotalTonnage != null">
  106. and INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
  107. </if>
  108. <if test="instructionTime != null">
  109. and TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = #{instructionTime}
  110. </if>
  111. <if test="deleteName != null and deleteName != ''">
  112. and DELETE_NAME LIKE '%${deleteName}%'
  113. </if>
  114. <if test="deleteTime != null and deleteTime != ''">
  115. and DELETE_TIME LIKE '%${deleteTime}%'
  116. </if>
  117. <if test="insertUsername != null and insertUsername != ''">
  118. and INSERT_USERNAME LIKE '%${insertUsername}%'
  119. </if>
  120. <if test="insertTime != null">
  121. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  122. </if>
  123. <if test="updateUsername != null and updateUsername != ''">
  124. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  125. </if>
  126. <if test="updateTime != null">
  127. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  128. </if>
  129. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  130. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  131. </if>
  132. <if test="deleted != null">
  133. and DELETED = #{deleted}
  134. </if>
  135. <if test="instructionIssueStatus != null and instructionIssueStatus != ''">
  136. and INSTRUCTION_ISSUE_STATUS LIKE '%${instructionIssueStatus}%'
  137. </if>
  138. </where>
  139. </sql>
  140. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  141. delete
  142. from OMSSHIP_SHIPMENT_INSTRUCTIONS
  143. where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
  144. </delete>
  145. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  146. delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
  147. where 1!=1
  148. <if test="batchId != null">
  149. or BATCH_ID = #{batchId}
  150. </if>
  151. <if test="recipientCarrierId != null">
  152. or RECIPIENT_CARRIER_ID = #{recipientCarrierId}
  153. </if>
  154. <if test="portCarrierId != null">
  155. or PORT_CARRIER_ID = #{portCarrierId}
  156. </if>
  157. <if test="instructionsTotalTonnage != null">
  158. or INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
  159. </if>
  160. <if test="instructionTime != null">
  161. or TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = '#{instructionTime}'
  162. </if>
  163. <if test="deleteName != null and deleteName != ''">
  164. or DELETE_NAME = #{deleteName}
  165. </if>
  166. <if test="deleteTime != null and deleteTime != ''">
  167. or DELETE_TIME = #{deleteTime}
  168. </if>
  169. <if test="insertUsername != null and insertUsername != ''">
  170. or INSERT_USERNAME = #{insertUsername}
  171. </if>
  172. <if test="insertTime != null">
  173. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  174. </if>
  175. <if test="updateUsername != null and updateUsername != ''">
  176. or UPDATE_USERNAME = #{updateUsername}
  177. </if>
  178. <if test="updateTime != null">
  179. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  180. </if>
  181. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  182. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  183. </if>
  184. <if test="deleted != null">
  185. or DELETED = #{deleted}
  186. </if>
  187. <if test="instructionIssueStatus != null and instructionIssueStatus != ''">
  188. or INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus}
  189. </if>
  190. </delete>
  191. <insert id="insert" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
  192. insert into OMSSHIP_SHIPMENT_INSTRUCTIONS (SHIPMENT_INSTRUCTIONS_ID, BATCH_ID,
  193. RECIPIENT_CARRIER_ID, PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
  194. INSTRUCTION_TIME, DELETE_NAME, DELETE_TIME,
  195. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  196. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  197. INSTRUCTION_ISSUE_STATUS)
  198. values (#{shipmentInstructionsId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL},
  199. #{recipientCarrierId,jdbcType=DECIMAL}, #{portCarrierId,jdbcType=DECIMAL},
  200. #{instructionsTotalTonnage,jdbcType=DECIMAL},
  201. #{instructionTime,jdbcType=TIMESTAMP}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
  202. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  203. #{updateUsername,jdbcType=VARCHAR},
  204. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  205. #{instructionIssueStatus,jdbcType=VARCHAR})
  206. </insert>
  207. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
  208. insert into OMSSHIP_SHIPMENT_INSTRUCTIONS
  209. <trim prefix="(" suffix=")" suffixOverrides=",">
  210. <if test="shipmentInstructionsId != null">
  211. SHIPMENT_INSTRUCTIONS_ID,
  212. </if>
  213. <if test="batchId != null">
  214. BATCH_ID,
  215. </if>
  216. <if test="recipientCarrierId != null">
  217. RECIPIENT_CARRIER_ID,
  218. </if>
  219. <if test="portCarrierId != null">
  220. PORT_CARRIER_ID,
  221. </if>
  222. <if test="instructionsTotalTonnage != null">
  223. INSTRUCTIONS_TOTAL_TONNAGE,
  224. </if>
  225. <if test="instructionTime != null">
  226. INSTRUCTION_TIME,
  227. </if>
  228. <if test="deleteName != null">
  229. DELETE_NAME,
  230. </if>
  231. <if test="deleteTime != null">
  232. DELETE_TIME,
  233. </if>
  234. <if test="insertUsername != null">
  235. INSERT_USERNAME,
  236. </if>
  237. <if test="insertTime != null">
  238. INSERT_TIME,
  239. </if>
  240. <if test="updateUsername != null">
  241. UPDATE_USERNAME,
  242. </if>
  243. <if test="updateTime != null">
  244. UPDATE_TIME,
  245. </if>
  246. <if test="insertUpdateRemark != null">
  247. INSERT_UPDATE_REMARK,
  248. </if>
  249. <if test="deleted != null">
  250. DELETED,
  251. </if>
  252. <if test="instructionIssueStatus != null">
  253. INSTRUCTION_ISSUE_STATUS,
  254. </if>
  255. </trim>
  256. <trim prefix="values (" suffix=")" suffixOverrides=",">
  257. <if test="shipmentInstructionsId != null">
  258. #{shipmentInstructionsId,jdbcType=DECIMAL},
  259. </if>
  260. <if test="batchId != null">
  261. #{batchId,jdbcType=DECIMAL},
  262. </if>
  263. <if test="recipientCarrierId != null">
  264. #{recipientCarrierId,jdbcType=DECIMAL},
  265. </if>
  266. <if test="portCarrierId != null">
  267. #{portCarrierId,jdbcType=DECIMAL},
  268. </if>
  269. <if test="instructionsTotalTonnage != null">
  270. #{instructionsTotalTonnage,jdbcType=DECIMAL},
  271. </if>
  272. <if test="instructionTime != null">
  273. #{instructionTime,jdbcType=TIMESTAMP},
  274. </if>
  275. <if test="deleteName != null">
  276. #{deleteName,jdbcType=VARCHAR},
  277. </if>
  278. <if test="deleteTime != null">
  279. #{deleteTime,jdbcType=VARCHAR},
  280. </if>
  281. <if test="insertUsername != null">
  282. #{insertUsername,jdbcType=VARCHAR},
  283. </if>
  284. <if test="insertTime != null">
  285. #{insertTime,jdbcType=TIMESTAMP},
  286. </if>
  287. <if test="updateUsername != null">
  288. #{updateUsername,jdbcType=VARCHAR},
  289. </if>
  290. <if test="updateTime != null">
  291. #{updateTime,jdbcType=TIMESTAMP},
  292. </if>
  293. <if test="insertUpdateRemark != null">
  294. #{insertUpdateRemark,jdbcType=VARCHAR},
  295. </if>
  296. <if test="deleted != null">
  297. #{deleted,jdbcType=DECIMAL},
  298. </if>
  299. <if test="instructionIssueStatus != null">
  300. #{instructionIssueStatus,jdbcType=VARCHAR},
  301. </if>
  302. </trim>
  303. </insert>
  304. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
  305. update OMSSHIP_SHIPMENT_INSTRUCTIONS
  306. set BATCH_ID = #{batchId,jdbcType=DECIMAL},
  307. RECIPIENT_CARRIER_ID = #{recipientCarrierId,jdbcType=DECIMAL},
  308. PORT_CARRIER_ID = #{portCarrierId,jdbcType=DECIMAL},
  309. INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage,jdbcType=DECIMAL},
  310. INSTRUCTION_TIME = #{instructionTime,jdbcType=TIMESTAMP},
  311. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  312. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  313. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  314. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  315. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  316. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  317. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  318. DELETED = #{deleted,jdbcType=DECIMAL},
  319. INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus,jdbcType=VARCHAR}
  320. where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
  321. </update>
  322. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
  323. update OMSSHIP_SHIPMENT_INSTRUCTIONS
  324. <set>
  325. <if test="batchId != null">
  326. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  327. </if>
  328. <if test="recipientCarrierId != null">
  329. RECIPIENT_CARRIER_ID = #{recipientCarrierId,jdbcType=DECIMAL},
  330. </if>
  331. <if test="portCarrierId != null">
  332. PORT_CARRIER_ID = #{portCarrierId,jdbcType=DECIMAL},
  333. </if>
  334. <if test="instructionsTotalTonnage != null">
  335. INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage,jdbcType=DECIMAL},
  336. </if>
  337. <if test="instructionTime != null">
  338. INSTRUCTION_TIME = #{instructionTime,jdbcType=TIMESTAMP},
  339. </if>
  340. <if test="deleteName != null">
  341. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  342. </if>
  343. <if test="deleteTime != null">
  344. DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
  345. </if>
  346. <if test="insertUsername != null">
  347. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  348. </if>
  349. <if test="insertTime != null">
  350. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  351. </if>
  352. <if test="updateUsername != null">
  353. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  354. </if>
  355. <if test="updateTime != null">
  356. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="insertUpdateRemark != null">
  359. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  360. </if>
  361. <if test="deleted != null">
  362. DELETED = #{deleted,jdbcType=DECIMAL},
  363. </if>
  364. <if test="instructionIssueStatus != null">
  365. INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus,jdbcType=VARCHAR},
  366. </if>
  367. </set>
  368. where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
  369. </update>
  370. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  371. <include refid="select"/>
  372. where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
  373. </select>
  374. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  375. <include refid="select"/>
  376. <include refid="where"/>
  377. </select>
  378. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  379. <include refid="select"/>
  380. <include refid="whereLike"/>
  381. </select>
  382. <insert id="batchInsert" parameterType="java.util.List">
  383. insert into OMSSHIP_SHIPMENT_INSTRUCTIONS
  384. (SHIPMENT_INSTRUCTIONS_ID,
  385. BATCH_ID, RECIPIENT_CARRIER_ID,
  386. PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
  387. INSTRUCTION_TIME, DELETE_NAME,
  388. DELETE_TIME, INSERT_USERNAME, INSERT_TIME,
  389. UPDATE_USERNAME, UPDATE_TIME,
  390. INSERT_UPDATE_REMARK, DELETED,
  391. INSTRUCTION_ISSUE_STATUS)
  392. ( <foreach collection="list" item="item" separator="union all">
  393. select
  394. #{item.shipmentInstructionsId,jdbcType=DECIMAL},
  395. #{item.batchId,jdbcType=DECIMAL}, #{item.recipientCarrierId,jdbcType=DECIMAL},
  396. #{item.portCarrierId,jdbcType=DECIMAL}, #{item.instructionsTotalTonnage,jdbcType=DECIMAL},
  397. #{item.instructionTime,jdbcType=TIMESTAMP}, #{item.deleteName,jdbcType=VARCHAR},
  398. #{item.deleteTime,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
  399. #{item.insertTime,jdbcType=TIMESTAMP},
  400. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  401. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  402. #{item.instructionIssueStatus,jdbcType=VARCHAR} from dual
  403. </foreach> )
  404. </insert>
  405. <update id="batchUpdate" parameterType="java.util.List">
  406. update OMSSHIP_SHIPMENT_INSTRUCTIONS
  407. set
  408. SHIPMENT_INSTRUCTIONS_ID=
  409. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  410. close="end">
  411. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.shipmentInstructionsId,jdbcType=DECIMAL}
  412. </foreach>
  413. ,BATCH_ID=
  414. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  415. close="end">
  416. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
  417. </foreach>
  418. ,RECIPIENT_CARRIER_ID=
  419. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  420. close="end">
  421. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.recipientCarrierId,jdbcType=DECIMAL}
  422. </foreach>
  423. ,PORT_CARRIER_ID=
  424. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  425. close="end">
  426. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.portCarrierId,jdbcType=DECIMAL}
  427. </foreach>
  428. ,INSTRUCTIONS_TOTAL_TONNAGE=
  429. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  430. close="end">
  431. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionsTotalTonnage,jdbcType=DECIMAL}
  432. </foreach>
  433. ,INSTRUCTION_TIME=
  434. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  435. close="end">
  436. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionTime,jdbcType=TIMESTAMP}
  437. </foreach>
  438. ,DELETE_NAME=
  439. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  440. close="end">
  441. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  442. </foreach>
  443. ,DELETE_TIME=
  444. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  445. close="end">
  446. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
  447. </foreach>
  448. ,INSERT_USERNAME=
  449. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  450. close="end">
  451. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  452. </foreach>
  453. ,INSERT_TIME=
  454. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  455. close="end">
  456. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  457. </foreach>
  458. ,UPDATE_USERNAME=
  459. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  460. close="end">
  461. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  462. </foreach>
  463. ,UPDATE_TIME=
  464. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  465. close="end">
  466. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  467. </foreach>
  468. ,INSERT_UPDATE_REMARK=
  469. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  470. close="end">
  471. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  472. </foreach>
  473. ,DELETED=
  474. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  475. close="end">
  476. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  477. </foreach>
  478. ,INSTRUCTION_ISSUE_STATUS=
  479. <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
  480. close="end">
  481. when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionIssueStatus,jdbcType=VARCHAR}
  482. </foreach>
  483. where SHIPMENT_INSTRUCTIONS_ID in
  484. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  485. #{item.shipmentInstructionsId,jdbcType=DECIMAL}
  486. </foreach>
  487. </update>
  488. <delete id="batchDelete" parameterType="java.util.List">
  489. delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
  490. where SHIPMENT_INSTRUCTIONS_ID in
  491. <foreach collection="list" item="id" open="(" close=")" separator=",">
  492. #{id}
  493. </foreach>
  494. </delete>
  495. <!-- 友情提示!!!-->
  496. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  497. <sql id="orderByInsertTime">
  498. <if test="orderField != null and orderField != ''">
  499. order by "${orderField}"
  500. <if test="orderType != null and orderType != ''">
  501. ${orderType}
  502. </if>
  503. </if>
  504. <if test="orderField == null ">
  505. order by "insertTime" desc
  506. </if>
  507. </sql>
  508. <select id="selectAll" resultType="java.util.Map">
  509. select *
  510. from(
  511. select distinct
  512. osi.SHIPMENT_INSTRUCTIONS_ID "instructionsId",
  513. osi.INSERT_TIME "insertTime",
  514. rpi.PIER_NAME "piername",
  515. rpo.PORT_NAME "portname",
  516. rpo.PORT_NAME "portname2",
  517. rm.MATERIAL_NAME "materialName",
  518. db.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
  519. rs.SHIPPER_NAME "shipperName",
  520. rs.SHIPPER_CONTACT_NUMBER "shipperContactNumber",
  521. osi.INSTRUCTION_TIME "instructionTime",
  522. osi.INSTRUCTIONS_TOTAL_TONNAGE "instruct"
  523. from OMSSHIP_SHIPMENT_INSTRUCTIONS osi
  524. left join AMSSHIP_DELIVERY_ATTORNEY ada
  525. on osi.BATCH_ID = ada.BATCH_ID
  526. left join RMS_PIER rpi
  527. on osi.RECIPIENT_CARRIER_ID=rpi.PIER_ID
  528. left join RMS_PORT rpo
  529. on osi.PORT_CARRIER_ID=rpo.PORT_ID
  530. left join AMSSHIP_DELIVERY_NOTICE adn
  531. on ada.BATCH_ID=adn.BATCH_ID
  532. left join DIL_BATCH db
  533. on osi.BATCH_ID = db.BATCH_ID
  534. left join RMS_MATERIAL rm
  535. on db.MATERIAL_ID = rm.MATERIAL_ID
  536. left join RMS_SHIPPER rs
  537. on adn.REQUESTER_GROUP_ID=rs.SHIPPER_ID
  538. where osi.DELETED = 0
  539. )
  540. <where>
  541. <if test="piername!= null">
  542. and
  543. <foreach collection="piername" item="item" open="(" separator="," close=")">
  544. "piername" in #{item}
  545. </foreach>
  546. </if>
  547. <if test="portname!= null">
  548. and
  549. <foreach collection="portname" item="item" open="(" separator="," close=")">
  550. "portname" in #{item}
  551. </foreach>
  552. </if>
  553. <if test="portname2!= null">
  554. and
  555. <foreach collection="portname2" item="item" open="(" separator="," close=")">
  556. "portname2" in #{item}
  557. </foreach>
  558. </if>
  559. <if test="materialName!= null">
  560. and
  561. <foreach collection="materialName" item="item" open="(" separator="," close=")">
  562. "materialName" in #{item}
  563. </foreach>
  564. </if>
  565. <if test="foreignShipName!= null">
  566. and
  567. <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
  568. "foreignShipName" in #{item}
  569. </foreach>
  570. </if>
  571. <if test="shipperName!= null">
  572. and
  573. <foreach collection="shipperName" item="item" open="(" separator="," close=")">
  574. "shipperName" in #{item}
  575. </foreach>
  576. </if>
  577. <if test="shipperContactNumber!= null">
  578. and
  579. <foreach collection="shipperContactNumber" item="item" open="(" separator="," close=")">
  580. "shipperContactNumber" in #{item}
  581. </foreach>
  582. </if>
  583. <if test="instructionTime!= null">
  584. and
  585. <foreach collection="instructionTime" item="item" open="(" separator="," close=")">
  586. "instructionTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
  587. </foreach>
  588. </if>
  589. <if test="instruct!= null">
  590. and
  591. <foreach collection="instruct" item="item" open="(" separator="," close=")">
  592. "instruct" in #{item}
  593. </foreach>
  594. </if>
  595. </where>
  596. <include refid="orderByInsertTime"></include>
  597. </select>
  598. <!-- 自动生成id-->
  599. <select id="selectMaxId" resultType="DECIMAL">
  600. SELECT MAX(SHIPMENT_INSTRUCTIONS_ID) + 1
  601. FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
  602. </select>
  603. <select id="selectShipmentInstructions" parameterType="DECIMAL" resultType="java.util.Map">
  604. SELECT BATCH_ID "batchId",
  605. RECIPIENT_CARRIER_ID "recipientCarrierId",
  606. PORT_CARRIER_ID "portCarrierId",
  607. INSTRUCTIONS_TOTAL_TONNAGE "instructionsTotalTonnage",
  608. INSTRUCTION_TIME "instructionTime"
  609. FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
  610. WHERE SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
  611. </select>
  612. <!--得到批次id-->
  613. <select id="getBatchId" resultType="java.util.LinkedHashMap">
  614. select BATCH_ID "id",
  615. BATCH_ID "value",
  616. CONCAT(CONCAT(RM.MATERIAL_NAME, '"'), CONCAT(DB.RESULT_FOREIGN_SHIP_NAME, '"')) "label"
  617. from DIL_BATCH DB
  618. left join RMS_MATERIAL RM
  619. on RM.MATERIAL_ID = DB.MATERIAL_ID
  620. </select>
  621. <!-- 得到港口和码头 -->
  622. <select id="getPortAndPier" parameterType="DECIMAL" resultType="java.util.Map">
  623. SELECT ACTR.GROUP_ID AS "pierId",
  624. ADN.PORT_ID AS "portId"
  625. FROM AMSSHIP_CARGO_TRANSFER_RESULT ACTR
  626. LEFT JOIN AMSSHIP_DELIVERY_NOTICE ADN
  627. ON ADN.BATCH_ID = ACTR.BATCH_ID
  628. WHERE ADN.BATCH_ID = #{batchId}
  629. </select>
  630. </mapper>