OmsshipInstructionsCapacityMapper.xml 24 KB

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