BmsshipContractPriceMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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.BmsshipContractPriceMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmsshipContractPrice">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="CONTRACT_NO" jdbcType="VARCHAR" property="contractNo" />
  7. <result column="UNIT_PRICE" jdbcType="DECIMAL" property="unitPrice" />
  8. <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
  9. <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime" />
  10. <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime" />
  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="PORT_ID" jdbcType="DECIMAL" property="portId" />
  17. <result column="SHIP_LENGTH" jdbcType="DECIMAL" property="shipLength" />
  18. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  19. </resultMap>
  20. <sql id="columns">
  21. RESULT_ID, CONTRACT_NO, UNIT_PRICE, BATCH_ID, START_TIME, END_TIME, INSERT_USERNAME,
  22. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, PORT_ID, SHIP_LENGTH,
  23. DELETED
  24. </sql>
  25. <sql id="columns_alias">
  26. t.RESULT_ID, t.CONTRACT_NO, t.UNIT_PRICE, t.BATCH_ID, t.START_TIME, t.END_TIME, t.INSERT_USERNAME,
  27. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.PORT_ID,
  28. t.SHIP_LENGTH, t.DELETED
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns" /> FROM BMSSHIP_CONTRACT_PRICE
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias" /> FROM BMSSHIP_CONTRACT_PRICE t
  35. </sql>
  36. <sql id="where">
  37. <where>
  38. <if test="resultId != null">
  39. and RESULT_ID = #{resultId}
  40. </if>
  41. <if test="contractNo != null and contractNo != ''">
  42. and CONTRACT_NO = #{contractNo}
  43. </if>
  44. <if test="unitPrice != null">
  45. and UNIT_PRICE = #{unitPrice}
  46. </if>
  47. <if test="batchId != null">
  48. and BATCH_ID = #{batchId}
  49. </if>
  50. <if test="startTime != null">
  51. and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
  52. </if>
  53. <if test="endTime != null">
  54. and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
  55. </if>
  56. <if test="insertUsername != null and insertUsername != ''">
  57. and INSERT_USERNAME = #{insertUsername}
  58. </if>
  59. <if test="insertTime != null">
  60. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  61. </if>
  62. <if test="updateUsername != null and updateUsername != ''">
  63. and UPDATE_USERNAME = #{updateUsername}
  64. </if>
  65. <if test="updateTime != null">
  66. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  67. </if>
  68. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  69. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  70. </if>
  71. <if test="portId != null">
  72. and PORT_ID = #{portId}
  73. </if>
  74. <if test="shipLength != null">
  75. and SHIP_LENGTH = #{shipLength}
  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="resultId != null">
  85. and RESULT_ID = #{resultId}
  86. </if>
  87. <if test="contractNo != null and contractNo != ''">
  88. and CONTRACT_NO LIKE '%${contractNo}%'
  89. </if>
  90. <if test="unitPrice != null">
  91. and UNIT_PRICE = #{unitPrice}
  92. </if>
  93. <if test="batchId != null">
  94. and BATCH_ID = #{batchId}
  95. </if>
  96. <if test="startTime != null">
  97. and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
  98. </if>
  99. <if test="endTime != null">
  100. and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
  101. </if>
  102. <if test="insertUsername != null and insertUsername != ''">
  103. and INSERT_USERNAME LIKE '%${insertUsername}%'
  104. </if>
  105. <if test="insertTime != null">
  106. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  107. </if>
  108. <if test="updateUsername != null and updateUsername != ''">
  109. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  110. </if>
  111. <if test="updateTime != null">
  112. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  113. </if>
  114. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  115. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  116. </if>
  117. <if test="portId != null">
  118. and PORT_ID = #{portId}
  119. </if>
  120. <if test="shipLength != null">
  121. and SHIP_LENGTH = #{shipLength}
  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 BMSSHIP_CONTRACT_PRICE
  130. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from BMSSHIP_CONTRACT_PRICE
  134. where 1!=1
  135. <if test="contractNo != null and contractNo != ''">
  136. or CONTRACT_NO = #{contractNo}
  137. </if>
  138. <if test="unitPrice != null">
  139. or UNIT_PRICE = #{unitPrice}
  140. </if>
  141. <if test="batchId != null">
  142. or BATCH_ID = #{batchId}
  143. </if>
  144. <if test="startTime != null">
  145. or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
  146. </if>
  147. <if test="endTime != null">
  148. or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
  149. </if>
  150. <if test="insertUsername != null and insertUsername != ''">
  151. or INSERT_USERNAME = #{insertUsername}
  152. </if>
  153. <if test="insertTime != null">
  154. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  155. </if>
  156. <if test="updateUsername != null and updateUsername != ''">
  157. or UPDATE_USERNAME = #{updateUsername}
  158. </if>
  159. <if test="updateTime != null">
  160. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  161. </if>
  162. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  163. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  164. </if>
  165. <if test="portId != null">
  166. or PORT_ID = #{portId}
  167. </if>
  168. <if test="shipLength != null">
  169. or SHIP_LENGTH = #{shipLength}
  170. </if>
  171. <if test="deleted != null">
  172. or DELETED = #{deleted}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
  176. insert into BMSSHIP_CONTRACT_PRICE (RESULT_ID, CONTRACT_NO, UNIT_PRICE,
  177. BATCH_ID, START_TIME, END_TIME,
  178. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  179. UPDATE_TIME, INSERT_UPDATE_REMARK, PORT_ID,
  180. SHIP_LENGTH, DELETED)
  181. values (#{resultId,jdbcType=DECIMAL}, #{contractNo,jdbcType=VARCHAR}, #{unitPrice,jdbcType=DECIMAL},
  182. #{batchId,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
  183. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  184. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{portId,jdbcType=DECIMAL},
  185. #{shipLength,jdbcType=DECIMAL}, #{deleted,jdbcType=DECIMAL})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
  188. insert into BMSSHIP_CONTRACT_PRICE
  189. <trim prefix="(" suffix=")" suffixOverrides=",">
  190. <if test="resultId != null">
  191. RESULT_ID,
  192. </if>
  193. <if test="contractNo != null">
  194. CONTRACT_NO,
  195. </if>
  196. <if test="unitPrice != null">
  197. UNIT_PRICE,
  198. </if>
  199. <if test="batchId != null">
  200. BATCH_ID,
  201. </if>
  202. <if test="startTime != null">
  203. START_TIME,
  204. </if>
  205. <if test="endTime != null">
  206. END_TIME,
  207. </if>
  208. <if test="insertUsername != null">
  209. INSERT_USERNAME,
  210. </if>
  211. <if test="insertTime != null">
  212. INSERT_TIME,
  213. </if>
  214. <if test="updateUsername != null">
  215. UPDATE_USERNAME,
  216. </if>
  217. <if test="updateTime != null">
  218. UPDATE_TIME,
  219. </if>
  220. <if test="insertUpdateRemark != null">
  221. INSERT_UPDATE_REMARK,
  222. </if>
  223. <if test="portId != null">
  224. PORT_ID,
  225. </if>
  226. <if test="shipLength != null">
  227. SHIP_LENGTH,
  228. </if>
  229. <if test="deleted != null">
  230. DELETED,
  231. </if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="resultId != null">
  235. #{resultId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="contractNo != null">
  238. #{contractNo,jdbcType=VARCHAR},
  239. </if>
  240. <if test="unitPrice != null">
  241. #{unitPrice,jdbcType=DECIMAL},
  242. </if>
  243. <if test="batchId != null">
  244. #{batchId,jdbcType=DECIMAL},
  245. </if>
  246. <if test="startTime != null">
  247. #{startTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="endTime != null">
  250. #{endTime,jdbcType=TIMESTAMP},
  251. </if>
  252. <if test="insertUsername != null">
  253. #{insertUsername,jdbcType=VARCHAR},
  254. </if>
  255. <if test="insertTime != null">
  256. #{insertTime,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="updateUsername != null">
  259. #{updateUsername,jdbcType=VARCHAR},
  260. </if>
  261. <if test="updateTime != null">
  262. #{updateTime,jdbcType=TIMESTAMP},
  263. </if>
  264. <if test="insertUpdateRemark != null">
  265. #{insertUpdateRemark,jdbcType=VARCHAR},
  266. </if>
  267. <if test="portId != null">
  268. #{portId,jdbcType=DECIMAL},
  269. </if>
  270. <if test="shipLength != null">
  271. #{shipLength,jdbcType=DECIMAL},
  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.BmsshipContractPrice">
  279. update BMSSHIP_CONTRACT_PRICE
  280. set CONTRACT_NO = #{contractNo,jdbcType=VARCHAR},
  281. UNIT_PRICE = #{unitPrice,jdbcType=DECIMAL},
  282. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  283. START_TIME = #{startTime,jdbcType=TIMESTAMP},
  284. END_TIME = #{endTime,jdbcType=TIMESTAMP},
  285. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  286. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  287. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  288. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  289. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  290. PORT_ID = #{portId,jdbcType=DECIMAL},
  291. SHIP_LENGTH = #{shipLength,jdbcType=DECIMAL},
  292. DELETED = #{deleted,jdbcType=DECIMAL}
  293. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  294. </update>
  295. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
  296. update BMSSHIP_CONTRACT_PRICE
  297. <set>
  298. <if test="contractNo != null">
  299. CONTRACT_NO = #{contractNo,jdbcType=VARCHAR},
  300. </if>
  301. <if test="unitPrice != null">
  302. UNIT_PRICE = #{unitPrice,jdbcType=DECIMAL},
  303. </if>
  304. <if test="batchId != null">
  305. BATCH_ID = #{batchId,jdbcType=DECIMAL},
  306. </if>
  307. <if test="startTime != null">
  308. START_TIME = #{startTime,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="endTime != null">
  311. END_TIME = #{endTime,jdbcType=TIMESTAMP},
  312. </if>
  313. <if test="insertUsername != null">
  314. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  315. </if>
  316. <if test="insertTime != null">
  317. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  318. </if>
  319. <if test="updateUsername != null">
  320. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  321. </if>
  322. <if test="updateTime != null">
  323. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  324. </if>
  325. <if test="insertUpdateRemark != null">
  326. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  327. </if>
  328. <if test="portId != null">
  329. PORT_ID = #{portId,jdbcType=DECIMAL},
  330. </if>
  331. <if test="shipLength != null">
  332. SHIP_LENGTH = #{shipLength,jdbcType=DECIMAL},
  333. </if>
  334. <if test="deleted != null">
  335. DELETED = #{deleted,jdbcType=DECIMAL},
  336. </if>
  337. </set>
  338. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  339. </update>
  340. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  341. <include refid="select" />
  342. where RESULT_ID = #{resultId,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 BMSSHIP_CONTRACT_PRICE
  354. (RESULT_ID,
  355. CONTRACT_NO, UNIT_PRICE, BATCH_ID,
  356. START_TIME, END_TIME, INSERT_USERNAME,
  357. INSERT_TIME, UPDATE_USERNAME,
  358. UPDATE_TIME, INSERT_UPDATE_REMARK,
  359. PORT_ID, SHIP_LENGTH, DELETED
  360. )
  361. ( <foreach collection="list" item="item" separator="union all">
  362. select
  363. #{item.resultId,jdbcType=DECIMAL},
  364. #{item.contractNo,jdbcType=VARCHAR}, #{item.unitPrice,jdbcType=DECIMAL}, #{item.batchId,jdbcType=DECIMAL},
  365. #{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  366. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  367. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  368. #{item.portId,jdbcType=DECIMAL}, #{item.shipLength,jdbcType=DECIMAL}, #{item.deleted,jdbcType=DECIMAL}
  369. from dual
  370. </foreach> )
  371. </insert>
  372. <update id="batchUpdate" parameterType="java.util.List">
  373. update BMSSHIP_CONTRACT_PRICE
  374. set
  375. RESULT_ID=
  376. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  377. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  378. </foreach>
  379. ,CONTRACT_NO=
  380. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  381. when #{item.resultId,jdbcType=DECIMAL} then #{item.contractNo,jdbcType=VARCHAR}
  382. </foreach>
  383. ,UNIT_PRICE=
  384. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  385. when #{item.resultId,jdbcType=DECIMAL} then #{item.unitPrice,jdbcType=DECIMAL}
  386. </foreach>
  387. ,BATCH_ID=
  388. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  389. when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
  390. </foreach>
  391. ,START_TIME=
  392. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  393. when #{item.resultId,jdbcType=DECIMAL} then #{item.startTime,jdbcType=TIMESTAMP}
  394. </foreach>
  395. ,END_TIME=
  396. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  397. when #{item.resultId,jdbcType=DECIMAL} then #{item.endTime,jdbcType=TIMESTAMP}
  398. </foreach>
  399. ,INSERT_USERNAME=
  400. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  401. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  402. </foreach>
  403. ,INSERT_TIME=
  404. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  405. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  406. </foreach>
  407. ,UPDATE_USERNAME=
  408. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  409. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  410. </foreach>
  411. ,UPDATE_TIME=
  412. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  413. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  414. </foreach>
  415. ,INSERT_UPDATE_REMARK=
  416. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  417. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  418. </foreach>
  419. ,PORT_ID=
  420. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  421. when #{item.resultId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
  422. </foreach>
  423. ,SHIP_LENGTH=
  424. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  425. when #{item.resultId,jdbcType=DECIMAL} then #{item.shipLength,jdbcType=DECIMAL}
  426. </foreach>
  427. ,DELETED=
  428. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  429. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  430. </foreach>
  431. where RESULT_ID in
  432. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  433. #{item.resultId,jdbcType=DECIMAL}
  434. </foreach>
  435. </update>
  436. <delete id="batchDelete" parameterType="java.util.List">
  437. delete from BMSSHIP_CONTRACT_PRICE
  438. where RESULT_ID in
  439. <foreach close=")" collection="list" item="id" open="(" separator=",">
  440. #{id}
  441. </foreach>
  442. </delete>
  443. <!-- 友情提示!!!-->
  444. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  445. <sql id="orderBy">
  446. <if test="orderField != null and orderField != ''">
  447. order by "${orderField}"
  448. <if test="orderType != null and orderType != ''">
  449. ${orderType}
  450. </if>
  451. </if>
  452. </sql>
  453. <select id="contractNoCompare" resultType="java.math.BigDecimal" parameterType="java.lang.String">
  454. select BCP.RESULT_ID "resultId"
  455. from BMSSHIP_CONTRACT_PRICE BCP
  456. WHERE BCP.CONTRACT_NO = #{contractNo}
  457. </select>
  458. <!-- 展示船运合同管理列表-->
  459. <select id="bmsshipContractPriceList" resultType="java.util.Map" parameterType="java.util.Map">
  460. select * from (
  461. select
  462. BCP.RESULT_ID "resultId",
  463. BCP.CONTRACT_NO "contractNo",
  464. BCP.START_TIME "startTime",
  465. BCP.END_TIME "endTime",
  466. BCP.UNIT_PRICE "unitPrice",
  467. RP.PORT_NAME "portName",
  468. BCP.PORT_ID "portId"
  469. from BMSSHIP_CONTRACT_PRICE BCP
  470. left join RMS_PORT RP
  471. on BCP.PORT_ID=RP.PORT_ID
  472. where BCP.DELETED=0
  473. <if test="con!=null">
  474. AND BCP.CONTRACT_NO like #{con}
  475. </if>
  476. <if test="startDate != null">
  477. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= BCP.END_TIME
  478. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= BCP.END_TIME
  479. </if>
  480. )
  481. <where>
  482. <if test="contractNo != null">
  483. and
  484. <foreach collection="contractNo" item="item" open="(" separator="or" close=")">
  485. "contractNo" like '%${item}%'
  486. </foreach>
  487. </if>
  488. <if test="startTime != null">
  489. and
  490. <foreach collection="startTime" item="item" open="(" separator="or" close=")">
  491. "startTime" like '%${item}%'
  492. </foreach>
  493. </if>
  494. <if test="endTime != null">
  495. and
  496. <foreach collection="endTime" item="item" open="(" separator="or" close=")">
  497. "endTime" like '%${item}%'
  498. </foreach>
  499. </if>
  500. <if test="unitPrice != null">
  501. and
  502. <foreach collection="unitPrice" item="item" open="(" separator="or" close=")">
  503. "unitPrice" like '%${item}%'
  504. </foreach>
  505. </if>
  506. <if test="portName != null">
  507. and
  508. <foreach collection="portName" item="item" open="(" separator="or" close=")">
  509. "portName" like '%${item}%'
  510. </foreach>
  511. </if>
  512. </where>
  513. <include refid="orderBy"></include>
  514. </select>
  515. <select id="selectBmsshipPriceList" resultType="java.util.Map" parameterType="java.math.BigDecimal">
  516. select BCP.CONTRACT_NO "contractNo",
  517. BCP.START_TIME "startTime",
  518. BCP.END_TIME "endTime",
  519. BCP.UNIT_PRICE "unitPrice",
  520. BCP.RESULT_ID "resultId",
  521. BCP.PORT_ID "portID"
  522. from BMSSHIP_CONTRACT_PRICE BCP
  523. WHERE BCP.RESULT_ID =#{resultId}
  524. </select>
  525. </mapper>