BmsshipDetailsOrderMapper.xml 29 KB

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