AmsContractTruckPriceMapper.xml 28 KB

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