TmsshipUnloadShipResultMapper.xml 26 KB

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