TmsshipShipLocationMapper.xml 23 KB

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