AmsContractTruckPriceMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  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.AmsContractTruckPriceMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsContractTransportPrice">
  5. <id column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
  6. <result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId" />
  7. <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
  8. <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
  9. <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
  10. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  11. <result column="PRICE_TON_KILOMETER" jdbcType="DECIMAL" property="priceTonKilometer" />
  12. <result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
  13. <result column="PRICE_DATE" jdbcType="TIMESTAMP" property="priceDate" />
  14. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  15. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  16. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  17. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  18. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  19. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  20. <result column="ADDRESS_ID" jdbcType="DECIMAL" property="addressId" />
  21. </resultMap>
  22. <sql id="columns">
  23. PRICE_ID, SHIPPER_ID, CARRIER_ID, LINE_ID, CAPACITY_ID, MATERIAL_ID, PRICE_TON_KILOMETER,
  24. PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  25. INSERT_UPDATE_REMARK, DELETED, ADDRESS_ID
  26. </sql>
  27. <sql id="columns_alias">
  28. t.PRICE_ID, t.SHIPPER_ID, t.CARRIER_ID, t.LINE_ID, t.CAPACITY_ID, t.MATERIAL_ID,
  29. t.PRICE_TON_KILOMETER, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, t.INSERT_TIME,
  30. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.ADDRESS_ID
  31. </sql>
  32. <sql id="select">
  33. SELECT <include refid="columns"/> FROM AMS_CONTRACT_TRANSPORT_PRICE
  34. </sql>
  35. <sql id="select_alias">
  36. SELECT <include refid="columns_alias"/> FROM AMS_CONTRACT_TRANSPORT_PRICE t
  37. </sql>
  38. <sql id="where">
  39. <where>
  40. <if test="priceId != null">
  41. and PRICE_ID = #{priceId}
  42. </if>
  43. <if test="shipperId != null">
  44. and SHIPPER_ID = #{shipperId}
  45. </if>
  46. <if test="carrierId != null">
  47. and CARRIER_ID = #{carrierId}
  48. </if>
  49. <if test="lineId != null">
  50. and LINE_ID = #{lineId}
  51. </if>
  52. <if test="capacityId != null">
  53. and CAPACITY_ID = #{capacityId}
  54. </if>
  55. <if test="materialId != null">
  56. and MATERIAL_ID = #{materialId}
  57. </if>
  58. <if test="priceTonKilometer != null">
  59. and PRICE_TON_KILOMETER = #{priceTonKilometer}
  60. </if>
  61. <if test="priceValue != null">
  62. and PRICE_VALUE = #{priceValue}
  63. </if>
  64. <if test="priceDate != null">
  65. and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
  66. </if>
  67. <if test="insertUsername != null and insertUsername != ''">
  68. and INSERT_USERNAME = #{insertUsername}
  69. </if>
  70. <if test="insertTime != null">
  71. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  72. </if>
  73. <if test="updateUsername != null and updateUsername != ''">
  74. and UPDATE_USERNAME = #{updateUsername}
  75. </if>
  76. <if test="updateTime != null">
  77. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  78. </if>
  79. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  80. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  81. </if>
  82. <if test="deleted != null">
  83. and DELETED = #{deleted}
  84. </if>
  85. <if test="addressId != null">
  86. and ADDRESS_ID = #{addressId}
  87. </if>
  88. </where>
  89. </sql>
  90. <sql id="whereLike">
  91. <where>
  92. <if test="priceId != null">
  93. and PRICE_ID = #{priceId}
  94. </if>
  95. <if test="shipperId != null">
  96. and SHIPPER_ID = #{shipperId}
  97. </if>
  98. <if test="carrierId != null">
  99. and CARRIER_ID = #{carrierId}
  100. </if>
  101. <if test="lineId != null">
  102. and LINE_ID = #{lineId}
  103. </if>
  104. <if test="capacityId != null">
  105. and CAPACITY_ID = #{capacityId}
  106. </if>
  107. <if test="materialId != null">
  108. and MATERIAL_ID = #{materialId}
  109. </if>
  110. <if test="priceTonKilometer != null">
  111. and PRICE_TON_KILOMETER = #{priceTonKilometer}
  112. </if>
  113. <if test="priceValue != null">
  114. and PRICE_VALUE = #{priceValue}
  115. </if>
  116. <if test="priceDate != null">
  117. and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
  118. </if>
  119. <if test="insertUsername != null and insertUsername != ''">
  120. and INSERT_USERNAME LIKE '%${insertUsername}%'
  121. </if>
  122. <if test="insertTime != null">
  123. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  124. </if>
  125. <if test="updateUsername != null and updateUsername != ''">
  126. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  127. </if>
  128. <if test="updateTime != null">
  129. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  130. </if>
  131. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  132. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  133. </if>
  134. <if test="deleted != null">
  135. and DELETED = #{deleted}
  136. </if>
  137. <if test="addressId != null">
  138. and ADDRESS_ID = #{addressId}
  139. </if>
  140. </where>
  141. </sql>
  142. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  143. delete from AMS_CONTRACT_TRANSPORT_PRICE
  144. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  145. </delete>
  146. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  147. delete from AMS_CONTRACT_TRANSPORT_PRICE
  148. where 1!=1
  149. <if test="shipperId != null">
  150. or SHIPPER_ID = #{shipperId}
  151. </if>
  152. <if test="carrierId != null">
  153. or CARRIER_ID = #{carrierId}
  154. </if>
  155. <if test="lineId != null">
  156. or LINE_ID = #{lineId}
  157. </if>
  158. <if test="capacityId != null">
  159. or CAPACITY_ID = #{capacityId}
  160. </if>
  161. <if test="materialId != null">
  162. or MATERIAL_ID = #{materialId}
  163. </if>
  164. <if test="priceTonKilometer != null">
  165. or PRICE_TON_KILOMETER = #{priceTonKilometer}
  166. </if>
  167. <if test="priceValue != null">
  168. or PRICE_VALUE = #{priceValue}
  169. </if>
  170. <if test="priceDate != null">
  171. or TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = '#{priceDate}'
  172. </if>
  173. <if test="insertUsername != null and insertUsername != ''">
  174. or INSERT_USERNAME = #{insertUsername}
  175. </if>
  176. <if test="insertTime != null">
  177. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  178. </if>
  179. <if test="updateUsername != null and updateUsername != ''">
  180. or UPDATE_USERNAME = #{updateUsername}
  181. </if>
  182. <if test="updateTime != null">
  183. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  184. </if>
  185. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  186. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  187. </if>
  188. <if test="deleted != null">
  189. or DELETED = #{deleted}
  190. </if>
  191. <if test="addressId != null">
  192. or ADDRESS_ID = #{addressId}
  193. </if>
  194. </delete>
  195. <insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  196. insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
  197. LINE_ID, CAPACITY_ID, MATERIAL_ID,
  198. PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE,
  199. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  200. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  201. ADDRESS_ID)
  202. values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
  203. #{lineId,jdbcType=DECIMAL}, #{capacityId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
  204. #{priceTonKilometer,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL}, #{priceDate,jdbcType=TIMESTAMP},
  205. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  206. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  207. #{addressId,jdbcType=DECIMAL})
  208. </insert>
  209. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  210. insert into AMS_CONTRACT_TRANSPORT_PRICE
  211. <trim prefix="(" suffix=")" suffixOverrides=",">
  212. <if test="priceId != null">
  213. PRICE_ID,
  214. </if>
  215. <if test="shipperId != null">
  216. SHIPPER_ID,
  217. </if>
  218. <if test="carrierId != null">
  219. CARRIER_ID,
  220. </if>
  221. <if test="lineId != null">
  222. LINE_ID,
  223. </if>
  224. <if test="capacityId != null">
  225. CAPACITY_ID,
  226. </if>
  227. <if test="materialId != null">
  228. MATERIAL_ID,
  229. </if>
  230. <if test="priceTonKilometer != null">
  231. PRICE_TON_KILOMETER,
  232. </if>
  233. <if test="priceValue != null">
  234. PRICE_VALUE,
  235. </if>
  236. <if test="priceDate != null">
  237. PRICE_DATE,
  238. </if>
  239. <if test="insertUsername != null">
  240. INSERT_USERNAME,
  241. </if>
  242. <if test="insertTime != null">
  243. INSERT_TIME,
  244. </if>
  245. <if test="updateUsername != null">
  246. UPDATE_USERNAME,
  247. </if>
  248. <if test="updateTime != null">
  249. UPDATE_TIME,
  250. </if>
  251. <if test="insertUpdateRemark != null">
  252. INSERT_UPDATE_REMARK,
  253. </if>
  254. <if test="deleted != null">
  255. DELETED,
  256. </if>
  257. <if test="addressId != null">
  258. ADDRESS_ID,
  259. </if>
  260. </trim>
  261. <trim prefix="values (" suffix=")" suffixOverrides=",">
  262. <if test="priceId != null">
  263. #{priceId,jdbcType=DECIMAL},
  264. </if>
  265. <if test="shipperId != null">
  266. #{shipperId,jdbcType=DECIMAL},
  267. </if>
  268. <if test="carrierId != null">
  269. #{carrierId,jdbcType=DECIMAL},
  270. </if>
  271. <if test="lineId != null">
  272. #{lineId,jdbcType=DECIMAL},
  273. </if>
  274. <if test="capacityId != null">
  275. #{capacityId,jdbcType=DECIMAL},
  276. </if>
  277. <if test="materialId != null">
  278. #{materialId,jdbcType=DECIMAL},
  279. </if>
  280. <if test="priceTonKilometer != null">
  281. #{priceTonKilometer,jdbcType=DECIMAL},
  282. </if>
  283. <if test="priceValue != null">
  284. #{priceValue,jdbcType=DECIMAL},
  285. </if>
  286. <if test="priceDate != null">
  287. #{priceDate,jdbcType=TIMESTAMP},
  288. </if>
  289. <if test="insertUsername != null">
  290. #{insertUsername,jdbcType=VARCHAR},
  291. </if>
  292. <if test="insertTime != null">
  293. #{insertTime,jdbcType=TIMESTAMP},
  294. </if>
  295. <if test="updateUsername != null">
  296. #{updateUsername,jdbcType=VARCHAR},
  297. </if>
  298. <if test="updateTime != null">
  299. #{updateTime,jdbcType=TIMESTAMP},
  300. </if>
  301. <if test="insertUpdateRemark != null">
  302. #{insertUpdateRemark,jdbcType=VARCHAR},
  303. </if>
  304. <if test="deleted != null">
  305. #{deleted,jdbcType=DECIMAL},
  306. </if>
  307. <if test="addressId != null">
  308. #{addressId,jdbcType=DECIMAL},
  309. </if>
  310. </trim>
  311. </insert>
  312. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  313. update AMS_CONTRACT_TRANSPORT_PRICE
  314. set SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  315. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  316. LINE_ID = #{lineId,jdbcType=DECIMAL},
  317. CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
  318. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  319. PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
  320. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  321. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  322. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  323. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  324. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  325. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  326. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  327. DELETED = #{deleted,jdbcType=DECIMAL},
  328. ADDRESS_ID = #{addressId,jdbcType=DECIMAL}
  329. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  330. </update>
  331. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  332. update AMS_CONTRACT_TRANSPORT_PRICE
  333. <set>
  334. <if test="shipperId != null">
  335. SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  336. </if>
  337. <if test="carrierId != null">
  338. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  339. </if>
  340. <if test="lineId != null">
  341. LINE_ID = #{lineId,jdbcType=DECIMAL},
  342. </if>
  343. <if test="capacityId != null">
  344. CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
  345. </if>
  346. <if test="materialId != null">
  347. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  348. </if>
  349. <if test="priceTonKilometer != null">
  350. PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
  351. </if>
  352. <if test="priceValue != null">
  353. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  354. </if>
  355. <if test="priceDate != null">
  356. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="insertUsername != null">
  359. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  360. </if>
  361. <if test="insertTime != null">
  362. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  363. </if>
  364. <if test="updateUsername != null">
  365. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  366. </if>
  367. <if test="updateTime != null">
  368. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  369. </if>
  370. <if test="insertUpdateRemark != null">
  371. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  372. </if>
  373. <if test="deleted != null">
  374. DELETED = #{deleted,jdbcType=DECIMAL},
  375. </if>
  376. <if test="addressId != null">
  377. ADDRESS_ID = #{addressId,jdbcType=DECIMAL},
  378. </if>
  379. </set>
  380. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  381. </update>
  382. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  383. <include refid="select"/>
  384. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  385. </select>
  386. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  387. <include refid="select"/>
  388. <include refid="where"/>
  389. </select>
  390. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  391. <include refid="select"/>
  392. <include refid="whereLike"/>
  393. </select>
  394. <insert id="batchInsert" parameterType="java.util.List">
  395. insert into AMS_CONTRACT_TRANSPORT_PRICE
  396. (PRICE_ID,
  397. SHIPPER_ID, CARRIER_ID, LINE_ID,
  398. CAPACITY_ID, MATERIAL_ID, PRICE_TON_KILOMETER,
  399. PRICE_VALUE, PRICE_DATE, INSERT_USERNAME,
  400. INSERT_TIME, UPDATE_USERNAME,
  401. UPDATE_TIME, INSERT_UPDATE_REMARK,
  402. DELETED, ADDRESS_ID)
  403. ( <foreach collection="list" item="item" separator="union all">
  404. select
  405. #{item.priceId,jdbcType=DECIMAL},
  406. #{item.shipperId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.lineId,jdbcType=DECIMAL},
  407. #{item.capacityId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.priceTonKilometer,jdbcType=DECIMAL},
  408. #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  409. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  410. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  411. #{item.deleted,jdbcType=DECIMAL}, #{item.addressId,jdbcType=DECIMAL} from dual
  412. </foreach> )
  413. </insert>
  414. <update id="batchUpdate" parameterType="java.util.List">
  415. update AMS_CONTRACT_TRANSPORT_PRICE
  416. set
  417. PRICE_ID=
  418. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  419. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
  420. </foreach>
  421. ,SHIPPER_ID=
  422. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  423. when #{item.priceId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
  424. </foreach>
  425. ,CARRIER_ID=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  427. when #{item.priceId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
  428. </foreach>
  429. ,LINE_ID=
  430. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  431. when #{item.priceId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  432. </foreach>
  433. ,CAPACITY_ID=
  434. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  435. when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
  436. </foreach>
  437. ,MATERIAL_ID=
  438. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  439. when #{item.priceId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  440. </foreach>
  441. ,PRICE_TON_KILOMETER=
  442. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  443. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceTonKilometer,jdbcType=DECIMAL}
  444. </foreach>
  445. ,PRICE_VALUE=
  446. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  447. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
  448. </foreach>
  449. ,PRICE_DATE=
  450. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  451. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
  452. </foreach>
  453. ,INSERT_USERNAME=
  454. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  455. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  456. </foreach>
  457. ,INSERT_TIME=
  458. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  459. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  460. </foreach>
  461. ,UPDATE_USERNAME=
  462. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  463. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  464. </foreach>
  465. ,UPDATE_TIME=
  466. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  467. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  468. </foreach>
  469. ,INSERT_UPDATE_REMARK=
  470. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  471. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  472. </foreach>
  473. ,DELETED=
  474. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  475. when #{item.priceId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  476. </foreach>
  477. ,ADDRESS_ID=
  478. <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
  479. when #{item.priceId,jdbcType=DECIMAL} then #{item.addressId,jdbcType=DECIMAL}
  480. </foreach>
  481. where PRICE_ID in
  482. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  483. #{item.priceId,jdbcType=DECIMAL}
  484. </foreach>
  485. </update>
  486. <delete id="batchDelete" parameterType="java.util.List">
  487. delete from AMS_CONTRACT_TRANSPORT_PRICE
  488. where PRICE_ID in
  489. <foreach collection="list" item="id" open="(" close=")" separator=",">
  490. #{id}
  491. </foreach>
  492. </delete>
  493. <!-- 友情提示!!!-->
  494. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  495. <select id="selectMaxId" resultType="java.math.BigDecimal">
  496. select max(PRICE_ID) from AMS_CONTRACT_TRANSPORT_PRICE
  497. </select>
  498. <select id="getAmsContractTransportPrice" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  499. select * from(
  500. select a_t_price.PRICE_ID "priceId",
  501. r_r_address.ADDRESS_PROVINCE "addressProvince",
  502. r_r_address.ADDRESS_DISTRICT "addressDistrict",
  503. r_r_address.ADDRESS_TOWN "addressTown",
  504. r_r_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
  505. r_line.LINE_PATH_LENGTH "linePathLength",
  506. a_t_price.PRICE_VALUE "priceValue",
  507. a_t_price.PRICE_TON_KILOMETER "priceTonKilometer",
  508. a_t_price.PRICE_DATE "priceDate"
  509. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  510. left join RMS_RECEIVE_ADDRESS r_r_address
  511. on a_t_price.ADDRESS_ID=r_r_address.ADDRESS_ID
  512. left join RMS_LINE r_line
  513. on a_t_price.LINE_ID=r_line.LINE_ID
  514. where a_t_price.DELETED = 0)
  515. <where>
  516. <if test="addressProvince != null">
  517. and
  518. <foreach collection="addressProvince" item="item" open="(" separator="or" close=")">
  519. "addressProvince" like '%${item}%'
  520. </foreach>
  521. </if>
  522. <if test="addressDistrict != null">
  523. and
  524. <foreach collection="addressDistrict" item="item" open="(" separator="or" close=")">
  525. "addressDistrict" like '%${item}%'
  526. </foreach>
  527. </if>
  528. <if test="addressTown != null">
  529. and
  530. <foreach collection="addressTown" item="item" open="(" separator="or" close=")">
  531. "addressTown" like '%${item}%'
  532. </foreach>
  533. </if>
  534. <if test="addressDeliveryAddress != null">
  535. and
  536. <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
  537. "addressDeliveryAddress" like '%${item}%'
  538. </foreach>
  539. </if>
  540. <if test="linePathLength != null">
  541. and
  542. <foreach collection="linePathLength" item="item" open="(" separator="or" close=")">
  543. "linePathLength" like '%${item}%'
  544. </foreach>
  545. </if>
  546. <if test="priceValue != null">
  547. and
  548. <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
  549. "priceValue" like '%${item}%'
  550. </foreach>
  551. </if>
  552. <if test="priceTonKilometer != null">
  553. and
  554. <foreach collection="priceTonKilometer" item="item" open="(" separator="or" close=")">
  555. "priceTonKilometer" like '%${item}%'
  556. </foreach>
  557. </if>
  558. <if test="priceDate != null">
  559. and
  560. <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
  561. "priceDate" like '%${item}%'
  562. </foreach>
  563. </if>
  564. </where>
  565. <include refid="orderBy"></include>
  566. </select>
  567. <sql id="orderBy">
  568. <if test="orderField != null and orderField != ''">
  569. order by "${orderField}"
  570. <if test="orderType != null and orderType != ''">
  571. ${orderType}
  572. </if>
  573. </if>
  574. </sql>
  575. <select id="getCarrierName" resultType="java.util.LinkedHashMap">
  576. select
  577. CARRIER_ID "id",
  578. CARRIER_ID "value",
  579. CARRIER_NAME "label"
  580. from RMS_CARRIER
  581. </select>
  582. <select id="getLineNo" resultType="java.util.LinkedHashMap">
  583. select
  584. LINE_ID "id",
  585. LINE_ID "value",
  586. LINE_NO "label"
  587. from RMS_LINE
  588. </select>
  589. <select id="getCapacityNumber" resultType="java.util.LinkedHashMap">
  590. select
  591. CAPACITY_ID "id",
  592. CAPACITY_ID "value",
  593. CAPACITY_NUMBER "label"
  594. from RMS_CAPACITY
  595. </select>
  596. <select id="getAddressDeliveryAddress" resultType="java.util.LinkedHashMap">
  597. select
  598. ADDRESS_ID "id",
  599. ADDRESS_ID "value",
  600. ADDRESS_DELIVERY_ADDRESS "label"
  601. from RMS_RECEIVE_ADDRESS
  602. </select>
  603. <select id="selectByPriceId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
  604. select a_t_price.SHIPPER_ID "shipperId",
  605. a_t_price.CARRIER_ID "carrierId",
  606. a_t_price.LINE_ID "lineId",
  607. a_t_price.CAPACITY_ID "capacityId",
  608. a_t_price.MATERIAL_ID "materialId",
  609. a_t_price.ADDRESS_ID "addressId",
  610. a_t_price.PRICE_VALUE "priceValue",
  611. a_t_price.PRICE_DATE "priceDate"
  612. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  613. where a_t_price.PRICE_ID = #{priceId}
  614. </select>
  615. <select id="getOriginAndNowOilPrice" resultType="java.util.LinkedHashMap">
  616. select rownum "rownum",
  617. r_o_price.PRICE_VALUE "priceValue"
  618. from RMS_OIL_PRICE r_o_price where r_o_price.PRICE_OIL_NAME='0号柴油'
  619. order by r_o_price.PRICE_DATE desc
  620. </select>
  621. <update id="batchUpdateTransportPriceByOilPrice" parameterType="double">
  622. update AMS_CONTRACT_TRANSPORT_PRICE
  623. set PRICE_VALUE = ROUND(PRICE_VALUE * 0.65 + PRICE_VALUE * 0.35 * (1 + #{updateOilPrice}),2)
  624. </update>
  625. <select id="getLinePathLength" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  626. select LINE_PATH_LENGTH "linePathLength" from RMS_LINE where LINE_ID = #{lineId}
  627. </select>
  628. <select id="getPriceValueAndPriceTonKilometer" resultType="java.util.LinkedHashMap">
  629. select a_t_price.PRICE_ID "priceId",
  630. a_t_price.PRICE_VALUE "priceValue",
  631. a_t_price.PRICE_TON_KILOMETER "priceTonKilometer"
  632. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  633. </select>
  634. <update id="updatePriceTonKilometer" parameterType="java.math.BigDecimal">
  635. update AMS_CONTRACT_TRANSPORT_PRICE set PRICE_TON_KILOMETER = #{priceTonKilometer}
  636. where PRICE_ID = #{priceId}
  637. </update>
  638. </mapper>