AmsContractTruckPriceMapper.xml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  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_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
  10. <result column="CARGONAME_ID" jdbcType="DECIMAL" property="cargonameId" />
  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="PLACE_ID" jdbcType="DECIMAL" property="placeId" />
  21. <result column="TYPE" jdbcType="DECIMAL" property="type" />
  22. <result column="DEPARTMENT" jdbcType="DECIMAL" property="department" />
  23. <result column="OILPRICE_BASE" jdbcType="DECIMAL" property="oilpriceBase" />
  24. <result column="OIL_TYPE_ID" jdbcType="DECIMAL" property="oilTypeId" />
  25. <result column="OILPRICE_CHANGE_THRESHOLD" jdbcType="DECIMAL" property="oilpriceChangeThreshold" />
  26. </resultMap>
  27. <sql id="columns">
  28. PRICE_ID, SHIPPER_ID, CARRIER_ID, LINE_ID, CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER,
  29. PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  30. INSERT_UPDATE_REMARK, DELETED, PLACE_ID, TYPE, DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
  31. OILPRICE_CHANGE_THRESHOLD
  32. </sql>
  33. <sql id="columns_alias">
  34. t.PRICE_ID, t.SHIPPER_ID, t.CARRIER_ID, t.LINE_ID, t.CAPACITY_TYPE_ID, t.CARGONAME_ID,
  35. t.PRICE_TON_KILOMETER, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, t.INSERT_TIME,
  36. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PLACE_ID,
  37. t.TYPE, t.DEPARTMENT, t.OILPRICE_BASE, t.OIL_TYPE_ID, t.OILPRICE_CHANGE_THRESHOLD
  38. </sql>
  39. <sql id="select">
  40. SELECT <include refid="columns" /> FROM AMS_CONTRACT_TRANSPORT_PRICE
  41. </sql>
  42. <sql id="select_alias">
  43. SELECT <include refid="columns_alias" /> FROM AMS_CONTRACT_TRANSPORT_PRICE t
  44. </sql>
  45. <sql id="where">
  46. <where>
  47. <if test="priceId != null">
  48. and PRICE_ID = #{priceId}
  49. </if>
  50. <if test="shipperId != null">
  51. and SHIPPER_ID = #{shipperId}
  52. </if>
  53. <if test="carrierId != null">
  54. and CARRIER_ID = #{carrierId}
  55. </if>
  56. <if test="lineId != null">
  57. and LINE_ID = #{lineId}
  58. </if>
  59. <if test="capacityTypeId != null">
  60. and CAPACITY_TYPE_ID = #{capacityTypeId}
  61. </if>
  62. <if test="cargonameId != null">
  63. and CARGONAME_ID = #{cargonameId}
  64. </if>
  65. <if test="priceTonKilometer != null">
  66. and PRICE_TON_KILOMETER = #{priceTonKilometer}
  67. </if>
  68. <if test="priceValue != null">
  69. and PRICE_VALUE = #{priceValue}
  70. </if>
  71. <if test="priceDate != null">
  72. and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
  73. </if>
  74. <if test="insertUsername != null and insertUsername != ''">
  75. and INSERT_USERNAME = #{insertUsername}
  76. </if>
  77. <if test="insertTime != null">
  78. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  79. </if>
  80. <if test="updateUsername != null and updateUsername != ''">
  81. and UPDATE_USERNAME = #{updateUsername}
  82. </if>
  83. <if test="updateTime != null">
  84. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  85. </if>
  86. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  87. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  88. </if>
  89. <if test="deleted != null">
  90. and DELETED = #{deleted}
  91. </if>
  92. <if test="placeId != null">
  93. and PLACE_ID = #{placeId}
  94. </if>
  95. <if test="type != null">
  96. and TYPE = #{type}
  97. </if>
  98. <if test="department != null">
  99. and DEPARTMENT = #{department}
  100. </if>
  101. <if test="oilpriceBase != null">
  102. and OILPRICE_BASE = #{oilpriceBase}
  103. </if>
  104. <if test="oilTypeId != null">
  105. and OIL_TYPE_ID = #{oilTypeId}
  106. </if>
  107. <if test="oilpriceChangeThreshold != null">
  108. and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
  109. </if>
  110. </where>
  111. </sql>
  112. <sql id="whereLike">
  113. <where>
  114. <if test="priceId != null">
  115. and PRICE_ID = #{priceId}
  116. </if>
  117. <if test="shipperId != null">
  118. and SHIPPER_ID = #{shipperId}
  119. </if>
  120. <if test="carrierId != null">
  121. and CARRIER_ID = #{carrierId}
  122. </if>
  123. <if test="lineId != null">
  124. and LINE_ID = #{lineId}
  125. </if>
  126. <if test="capacityTypeId != null">
  127. and CAPACITY_TYPE_ID = #{capacityTypeId}
  128. </if>
  129. <if test="cargonameId != null">
  130. and CARGONAME_ID = #{cargonameId}
  131. </if>
  132. <if test="priceTonKilometer != null">
  133. and PRICE_TON_KILOMETER = #{priceTonKilometer}
  134. </if>
  135. <if test="priceValue != null">
  136. and PRICE_VALUE = #{priceValue}
  137. </if>
  138. <if test="priceDate != null">
  139. and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
  140. </if>
  141. <if test="insertUsername != null and insertUsername != ''">
  142. and INSERT_USERNAME LIKE '%${insertUsername}%'
  143. </if>
  144. <if test="insertTime != null">
  145. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  146. </if>
  147. <if test="updateUsername != null and updateUsername != ''">
  148. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  149. </if>
  150. <if test="updateTime != null">
  151. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  152. </if>
  153. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  154. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  155. </if>
  156. <if test="deleted != null">
  157. and DELETED = #{deleted}
  158. </if>
  159. <if test="placeId != null">
  160. and PLACE_ID = #{placeId}
  161. </if>
  162. <if test="type != null">
  163. and TYPE = #{type}
  164. </if>
  165. <if test="department != null">
  166. and DEPARTMENT = #{department}
  167. </if>
  168. <if test="oilpriceBase != null">
  169. and OILPRICE_BASE = #{oilpriceBase}
  170. </if>
  171. <if test="oilTypeId != null">
  172. and OIL_TYPE_ID = #{oilTypeId}
  173. </if>
  174. <if test="oilpriceChangeThreshold != null">
  175. and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
  176. </if>
  177. </where>
  178. </sql>
  179. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  180. delete from AMS_CONTRACT_TRANSPORT_PRICE
  181. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  182. </delete>
  183. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  184. delete from AMS_CONTRACT_TRANSPORT_PRICE
  185. where 1!=1
  186. <if test="shipperId != null">
  187. or SHIPPER_ID = #{shipperId}
  188. </if>
  189. <if test="carrierId != null">
  190. or CARRIER_ID = #{carrierId}
  191. </if>
  192. <if test="lineId != null">
  193. or LINE_ID = #{lineId}
  194. </if>
  195. <if test="capacityTypeId != null">
  196. or CAPACITY_TYPE_ID = #{capacityTypeId}
  197. </if>
  198. <if test="cargonameId != null">
  199. or CARGONAME_ID = #{cargonameId}
  200. </if>
  201. <if test="priceTonKilometer != null">
  202. or PRICE_TON_KILOMETER = #{priceTonKilometer}
  203. </if>
  204. <if test="priceValue != null">
  205. or PRICE_VALUE = #{priceValue}
  206. </if>
  207. <if test="priceDate != null">
  208. or TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = '#{priceDate}'
  209. </if>
  210. <if test="insertUsername != null and insertUsername != ''">
  211. or INSERT_USERNAME = #{insertUsername}
  212. </if>
  213. <if test="insertTime != null">
  214. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  215. </if>
  216. <if test="updateUsername != null and updateUsername != ''">
  217. or UPDATE_USERNAME = #{updateUsername}
  218. </if>
  219. <if test="updateTime != null">
  220. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  221. </if>
  222. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  223. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  224. </if>
  225. <if test="deleted != null">
  226. or DELETED = #{deleted}
  227. </if>
  228. <if test="placeId != null">
  229. or PLACE_ID = #{placeId}
  230. </if>
  231. <if test="type != null">
  232. or TYPE = #{type}
  233. </if>
  234. <if test="department != null">
  235. or DEPARTMENT = #{department}
  236. </if>
  237. <if test="oilpriceBase != null">
  238. or OILPRICE_BASE = #{oilpriceBase}
  239. </if>
  240. <if test="oilTypeId != null">
  241. or OIL_TYPE_ID = #{oilTypeId}
  242. </if>
  243. <if test="oilpriceChangeThreshold != null">
  244. or OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
  245. </if>
  246. </delete>
  247. <insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  248. insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
  249. LINE_ID, CAPACITY_TYPE_ID, CARGONAME_ID,
  250. PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE,
  251. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  252. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  253. PLACE_ID, TYPE, DEPARTMENT,
  254. OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD
  255. )
  256. values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
  257. #{lineId,jdbcType=DECIMAL}, #{capacityTypeId,jdbcType=DECIMAL}, #{cargonameId,jdbcType=DECIMAL},
  258. #{priceTonKilometer,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL}, #{priceDate,jdbcType=TIMESTAMP},
  259. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  260. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  261. #{placeId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL},
  262. #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL}
  263. )
  264. </insert>
  265. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  266. insert into AMS_CONTRACT_TRANSPORT_PRICE
  267. <trim prefix="(" suffix=")" suffixOverrides=",">
  268. <if test="priceId != null">
  269. PRICE_ID,
  270. </if>
  271. <if test="shipperId != null">
  272. SHIPPER_ID,
  273. </if>
  274. <if test="carrierId != null">
  275. CARRIER_ID,
  276. </if>
  277. <if test="lineId != null">
  278. LINE_ID,
  279. </if>
  280. <if test="capacityTypeId != null">
  281. CAPACITY_TYPE_ID,
  282. </if>
  283. <if test="cargonameId != null">
  284. CARGONAME_ID,
  285. </if>
  286. <if test="priceTonKilometer != null">
  287. PRICE_TON_KILOMETER,
  288. </if>
  289. <if test="priceValue != null">
  290. PRICE_VALUE,
  291. </if>
  292. <if test="priceDate != null">
  293. PRICE_DATE,
  294. </if>
  295. <if test="insertUsername != null">
  296. INSERT_USERNAME,
  297. </if>
  298. <if test="insertTime != null">
  299. INSERT_TIME,
  300. </if>
  301. <if test="updateUsername != null">
  302. UPDATE_USERNAME,
  303. </if>
  304. <if test="updateTime != null">
  305. UPDATE_TIME,
  306. </if>
  307. <if test="insertUpdateRemark != null">
  308. INSERT_UPDATE_REMARK,
  309. </if>
  310. <if test="deleted != null">
  311. DELETED,
  312. </if>
  313. <if test="placeId != null">
  314. PLACE_ID,
  315. </if>
  316. <if test="type != null">
  317. TYPE,
  318. </if>
  319. <if test="department != null">
  320. DEPARTMENT,
  321. </if>
  322. <if test="oilpriceBase != null">
  323. OILPRICE_BASE,
  324. </if>
  325. <if test="oilTypeId != null">
  326. OIL_TYPE_ID,
  327. </if>
  328. <if test="oilpriceChangeThreshold != null">
  329. OILPRICE_CHANGE_THRESHOLD,
  330. </if>
  331. </trim>
  332. <trim prefix="values (" suffix=")" suffixOverrides=",">
  333. <if test="priceId != null">
  334. #{priceId,jdbcType=DECIMAL},
  335. </if>
  336. <if test="shipperId != null">
  337. #{shipperId,jdbcType=DECIMAL},
  338. </if>
  339. <if test="carrierId != null">
  340. #{carrierId,jdbcType=DECIMAL},
  341. </if>
  342. <if test="lineId != null">
  343. #{lineId,jdbcType=DECIMAL},
  344. </if>
  345. <if test="capacityTypeId != null">
  346. #{capacityTypeId,jdbcType=DECIMAL},
  347. </if>
  348. <if test="cargonameId != null">
  349. #{cargonameId,jdbcType=DECIMAL},
  350. </if>
  351. <if test="priceTonKilometer != null">
  352. #{priceTonKilometer,jdbcType=DECIMAL},
  353. </if>
  354. <if test="priceValue != null">
  355. #{priceValue,jdbcType=DECIMAL},
  356. </if>
  357. <if test="priceDate != null">
  358. #{priceDate,jdbcType=TIMESTAMP},
  359. </if>
  360. <if test="insertUsername != null">
  361. #{insertUsername,jdbcType=VARCHAR},
  362. </if>
  363. <if test="insertTime != null">
  364. #{insertTime,jdbcType=TIMESTAMP},
  365. </if>
  366. <if test="updateUsername != null">
  367. #{updateUsername,jdbcType=VARCHAR},
  368. </if>
  369. <if test="updateTime != null">
  370. #{updateTime,jdbcType=TIMESTAMP},
  371. </if>
  372. <if test="insertUpdateRemark != null">
  373. #{insertUpdateRemark,jdbcType=VARCHAR},
  374. </if>
  375. <if test="deleted != null">
  376. #{deleted,jdbcType=DECIMAL},
  377. </if>
  378. <if test="placeId != null">
  379. #{placeId,jdbcType=DECIMAL},
  380. </if>
  381. <if test="type != null">
  382. #{type,jdbcType=DECIMAL},
  383. </if>
  384. <if test="department != null">
  385. #{department,jdbcType=DECIMAL},
  386. </if>
  387. <if test="oilpriceBase != null">
  388. #{oilpriceBase,jdbcType=DECIMAL},
  389. </if>
  390. <if test="oilTypeId != null">
  391. #{oilTypeId,jdbcType=DECIMAL},
  392. </if>
  393. <if test="oilpriceChangeThreshold != null">
  394. #{oilpriceChangeThreshold,jdbcType=DECIMAL},
  395. </if>
  396. </trim>
  397. </insert>
  398. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  399. update AMS_CONTRACT_TRANSPORT_PRICE
  400. set SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  401. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  402. LINE_ID = #{lineId,jdbcType=DECIMAL},
  403. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  404. CARGONAME_ID = #{cargonameId,jdbcType=DECIMAL},
  405. PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
  406. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  407. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  408. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  409. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  410. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  411. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  412. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  413. DELETED = #{deleted,jdbcType=DECIMAL},
  414. PLACE_ID = #{placeId,jdbcType=DECIMAL},
  415. TYPE = #{type,jdbcType=DECIMAL},
  416. DEPARTMENT = #{department,jdbcType=DECIMAL},
  417. OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
  418. OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
  419. OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL}
  420. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  421. </update>
  422. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  423. update AMS_CONTRACT_TRANSPORT_PRICE
  424. <set>
  425. <if test="shipperId != null">
  426. SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  427. </if>
  428. <if test="carrierId != null">
  429. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  430. </if>
  431. <if test="lineId != null">
  432. LINE_ID = #{lineId,jdbcType=DECIMAL},
  433. </if>
  434. <if test="capacityTypeId != null">
  435. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  436. </if>
  437. <if test="cargonameId != null">
  438. CARGONAME_ID = #{cargonameId,jdbcType=DECIMAL},
  439. </if>
  440. <if test="priceTonKilometer != null">
  441. PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
  442. </if>
  443. <if test="priceValue != null">
  444. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  445. </if>
  446. <if test="priceDate != null">
  447. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  448. </if>
  449. <if test="insertUsername != null">
  450. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  451. </if>
  452. <if test="insertTime != null">
  453. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  454. </if>
  455. <if test="updateUsername != null">
  456. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  457. </if>
  458. <if test="updateTime != null">
  459. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  460. </if>
  461. <if test="insertUpdateRemark != null">
  462. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  463. </if>
  464. <if test="deleted != null">
  465. DELETED = #{deleted,jdbcType=DECIMAL},
  466. </if>
  467. <if test="placeId != null">
  468. PLACE_ID = #{placeId,jdbcType=DECIMAL},
  469. </if>
  470. <if test="type != null">
  471. TYPE = #{type,jdbcType=DECIMAL},
  472. </if>
  473. <if test="department != null">
  474. DEPARTMENT = #{department,jdbcType=DECIMAL},
  475. </if>
  476. <if test="oilpriceBase != null">
  477. OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
  478. </if>
  479. <if test="oilTypeId != null">
  480. OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
  481. </if>
  482. <if test="oilpriceChangeThreshold != null">
  483. OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
  484. </if>
  485. </set>
  486. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  487. </update>
  488. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  489. <include refid="select" />
  490. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  491. </select>
  492. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  493. <include refid="select" />
  494. <include refid="where" />
  495. </select>
  496. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  497. <include refid="select" />
  498. <include refid="whereLike" />
  499. </select>
  500. <insert id="batchInsert" parameterType="java.util.List">
  501. insert into AMS_CONTRACT_TRANSPORT_PRICE
  502. (PRICE_ID,
  503. SHIPPER_ID, CARRIER_ID, LINE_ID,
  504. CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER,
  505. PRICE_VALUE, PRICE_DATE, INSERT_USERNAME,
  506. INSERT_TIME, UPDATE_USERNAME,
  507. UPDATE_TIME, INSERT_UPDATE_REMARK,
  508. DELETED, PLACE_ID, TYPE,
  509. DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
  510. OILPRICE_CHANGE_THRESHOLD)
  511. ( <foreach collection="list" item="item" separator="union all">
  512. select
  513. #{item.priceId,jdbcType=DECIMAL},
  514. #{item.shipperId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.lineId,jdbcType=DECIMAL},
  515. #{item.capacityTypeId,jdbcType=DECIMAL}, #{item.cargonameId,jdbcType=DECIMAL}, #{item.priceTonKilometer,jdbcType=DECIMAL},
  516. #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  517. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  518. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  519. #{item.deleted,jdbcType=DECIMAL}, #{item.placeId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL},
  520. #{item.department,jdbcType=DECIMAL}, #{item.oilpriceBase,jdbcType=DECIMAL}, #{item.oilTypeId,jdbcType=DECIMAL},
  521. #{item.oilpriceChangeThreshold,jdbcType=DECIMAL} from dual
  522. </foreach> )
  523. </insert>
  524. <update id="batchUpdate" parameterType="java.util.List">
  525. update AMS_CONTRACT_TRANSPORT_PRICE
  526. set
  527. PRICE_ID=
  528. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  529. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
  530. </foreach>
  531. ,SHIPPER_ID=
  532. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  533. when #{item.priceId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
  534. </foreach>
  535. ,CARRIER_ID=
  536. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  537. when #{item.priceId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
  538. </foreach>
  539. ,LINE_ID=
  540. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  541. when #{item.priceId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  542. </foreach>
  543. ,CAPACITY_TYPE_ID=
  544. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  545. when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
  546. </foreach>
  547. ,CARGONAME_ID=
  548. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  549. when #{item.priceId,jdbcType=DECIMAL} then #{item.cargonameId,jdbcType=DECIMAL}
  550. </foreach>
  551. ,PRICE_TON_KILOMETER=
  552. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  553. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceTonKilometer,jdbcType=DECIMAL}
  554. </foreach>
  555. ,PRICE_VALUE=
  556. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  557. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
  558. </foreach>
  559. ,PRICE_DATE=
  560. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  561. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
  562. </foreach>
  563. ,INSERT_USERNAME=
  564. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  565. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  566. </foreach>
  567. ,INSERT_TIME=
  568. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  569. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  570. </foreach>
  571. ,UPDATE_USERNAME=
  572. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  573. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  574. </foreach>
  575. ,UPDATE_TIME=
  576. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  577. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  578. </foreach>
  579. ,INSERT_UPDATE_REMARK=
  580. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  581. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  582. </foreach>
  583. ,DELETED=
  584. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  585. when #{item.priceId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  586. </foreach>
  587. ,PLACE_ID=
  588. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  589. when #{item.priceId,jdbcType=DECIMAL} then #{item.placeId,jdbcType=DECIMAL}
  590. </foreach>
  591. ,TYPE=
  592. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  593. when #{item.priceId,jdbcType=DECIMAL} then #{item.type,jdbcType=DECIMAL}
  594. </foreach>
  595. ,DEPARTMENT=
  596. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  597. when #{item.priceId,jdbcType=DECIMAL} then #{item.department,jdbcType=DECIMAL}
  598. </foreach>
  599. ,OILPRICE_BASE=
  600. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  601. when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceBase,jdbcType=DECIMAL}
  602. </foreach>
  603. ,OIL_TYPE_ID=
  604. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  605. when #{item.priceId,jdbcType=DECIMAL} then #{item.oilTypeId,jdbcType=DECIMAL}
  606. </foreach>
  607. ,OILPRICE_CHANGE_THRESHOLD=
  608. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  609. when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceChangeThreshold,jdbcType=DECIMAL}
  610. </foreach>
  611. where PRICE_ID in
  612. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  613. #{item.priceId,jdbcType=DECIMAL}
  614. </foreach>
  615. </update>
  616. <delete id="batchDelete" parameterType="java.util.List">
  617. delete from AMS_CONTRACT_TRANSPORT_PRICE
  618. where PRICE_ID in
  619. <foreach close=")" collection="list" item="id" open="(" separator=",">
  620. #{id}
  621. </foreach>
  622. </delete>
  623. <!-- 友情提示!!!-->
  624. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  625. <select id="getAmsContractTransportPrice" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  626. select * from(
  627. select a_t_price.PRICE_ID "priceId",
  628. r_r_address.ADDRESS_PROVINCE "addressProvince",
  629. r_r_address.ADDRESS_DISTRICT "addressDistrict",
  630. r_r_address.ADDRESS_TOWN "addressTown",
  631. rrp.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
  632. r_carrier.CARRIER_NAME "carrierName",
  633. r_line.LINE_PATH_LENGTH "linePathLength",
  634. r_o_type.OIL_TYPE_NAME "oilTypeName",
  635. r_c_type.CAPACITY_TYPE_NAME "capacityTypeName",
  636. a_t_price.PRICE_VALUE "priceValue",
  637. a_t_price.PRICE_TON_KILOMETER "priceTonKilometer",
  638. a_t_price.PRICE_DATE "priceDate",
  639. a_t_price.OILPRICE_BASE "oilpriceBase",
  640. a_t_price.INSERT_TIME "insertTime",
  641. rs.SHIPPER_NAME "shipperName",
  642. a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold"
  643. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  644. left join RMS_RECEIVE_PLACE rrp
  645. on a_t_price.PLACE_ID=rrp.PLACE_ID
  646. left join RMS_RECEIVE_ADDRESS r_r_address
  647. on rrp.ADDRESS_ID = r_r_address.ADDRESS_ID
  648. left join RMS_CAPACITY_TYPE r_c_type
  649. on a_t_price.CAPACITY_TYPE_ID=r_c_type.CAPACITY_TYPE_ID
  650. left join RMS_CARRIER r_carrier
  651. on a_t_price.CARRIER_ID=r_carrier.CARRIER_ID
  652. left join RMS_LINE r_line
  653. on a_t_price.LINE_ID=r_line.LINE_ID
  654. left join RMS_OIL_TYPE r_o_type
  655. on a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
  656. left join RMS_SHIPPER rs
  657. on rs.SHIPPER_ID = a_t_price.SHIPPER_ID
  658. -- where a_t_price.DELETED = 0
  659. -- and a_t_price.TYPE = 1 and a_t_price.DEPARTMENT = 2
  660. <where>
  661. <if test="deleted != null">
  662. and a_t_price.DELETED = #{deleted}
  663. </if>
  664. </where>
  665. )
  666. <where>
  667. <if test="addressProvince != null">
  668. and
  669. <foreach collection="addressProvince" item="item" open="(" separator="or" close=")">
  670. "addressProvince" like '%${item}%'
  671. </foreach>
  672. </if>
  673. <if test="shipperName != null">
  674. and
  675. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  676. "shipperName" like '%${item}%'
  677. </foreach>
  678. </if>
  679. <if test="addressDistrict != null">
  680. and
  681. <foreach collection="addressDistrict" item="item" open="(" separator="or" close=")">
  682. "addressDistrict" like '%${item}%'
  683. </foreach>
  684. </if>
  685. <if test="addressTown != null">
  686. and
  687. <foreach collection="addressTown" item="item" open="(" separator="or" close=")">
  688. "addressTown" like '%${item}%'
  689. </foreach>
  690. </if>
  691. <if test="addressDeliveryAddress != null">
  692. and
  693. <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
  694. "addressDeliveryAddress" like '%${item}%'
  695. </foreach>
  696. </if>
  697. <if test="linePathLength != null">
  698. and
  699. <foreach collection="linePathLength" item="item" open="(" separator="or" close=")">
  700. "linePathLength" like '%${item}%'
  701. </foreach>
  702. </if>
  703. <if test="carrierName != null">
  704. and
  705. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  706. "carrierName" like '%${item}%'
  707. </foreach>
  708. </if>
  709. <if test="capacityTypeName != null">
  710. and
  711. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  712. "capacityTypeName" like '%${item}%'
  713. </foreach>
  714. </if>
  715. <if test="priceValue != null">
  716. and
  717. <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
  718. "priceValue" like '%${item}%'
  719. </foreach>
  720. </if>
  721. <if test="priceTonKilometer != null">
  722. and
  723. <foreach collection="priceTonKilometer" item="item" open="(" separator="or" close=")">
  724. "priceTonKilometer" like '%${item}%'
  725. </foreach>
  726. </if>
  727. <if test="priceDate != null">
  728. and
  729. <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
  730. "priceDate" like '%${item}%'
  731. </foreach>
  732. </if>
  733. </where>
  734. <include refid="orderBy"></include>
  735. <if test="orderField == null ">
  736. order by "priceDate" desc
  737. </if>
  738. </select>
  739. <sql id="orderBy">
  740. <if test="orderField != null and orderField != ''">
  741. order by "${orderField}"
  742. <if test="orderType != null and orderType != ''">
  743. ${orderType}
  744. </if>
  745. </if>
  746. </sql>
  747. <select id="getCarrierName" resultType="java.util.LinkedHashMap">
  748. select
  749. CARRIER_ID "id",
  750. CARRIER_ID "value",
  751. CARRIER_NAME "label"
  752. from RMS_CARRIER
  753. </select>
  754. <select id="getLineNo" resultType="java.util.LinkedHashMap">
  755. select
  756. LINE_ID "id",
  757. LINE_ID "value",
  758. LINE_NO "label"
  759. from RMS_LINE
  760. </select>
  761. <select id="getCapacityNumber" resultType="java.util.LinkedHashMap">
  762. select
  763. CAPACITY_ID "id",
  764. CAPACITY_ID "value",
  765. CAPACITY_NUMBER "label"
  766. from RMS_CAPACITY
  767. </select>
  768. <select id="getAddressDeliveryAddress" resultType="java.util.LinkedHashMap">
  769. SELECT * FROM
  770. (SELECT RRA.ADDRESS_ID "addressId",
  771. CONCAT(CONCAT(CONCAT(RRA.ADDRESS_PROVINCE, RRA.ADDRESS_DISTRICT), RRA.ADDRESS_TOWN), RRA.ADDRESS_DELIVERY_ADDRESS) "address"
  772. FROM RMS_RECEIVE_ADDRESS RRA) RRRA
  773. <if test="con != null" >
  774. WHERE RRRA."address" LIKE #{con}
  775. </if>
  776. </select>
  777. <select id="selectByPriceId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
  778. select a_t_price.SHIPPER_ID "shipperId",
  779. a_t_price.CARRIER_ID "carrierId",
  780. a_t_price.LINE_ID "lineId",
  781. a_t_price.CAPACITY_ID "capacityId",
  782. a_t_price.MATERIAL_ID "materialId",
  783. a_t_price.PLACE_ID "placeId",
  784. a_t_price.PRICE_VALUE "priceValue",
  785. a_t_price.PRICE_DATE "priceDate"
  786. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  787. where a_t_price.PRICE_ID = #{priceId}
  788. </select>
  789. <select id="getOriginAndNowOilPrice" resultType="java.util.LinkedHashMap">
  790. select rownum "rownum",
  791. r_o_price.PRICE_VALUE "priceValue"
  792. from RMS_OIL_PRICE r_o_price where r_o_price.PRICE_OIL_NAME='0号柴油'
  793. order by r_o_price.PRICE_DATE desc
  794. </select>
  795. <update id="batchUpdateTransportPriceByOilPrice" parameterType="double">
  796. update AMS_CONTRACT_TRANSPORT_PRICE
  797. set PRICE_VALUE = ROUND(PRICE_VALUE * 0.65 + PRICE_VALUE * 0.35 * (1 + #{updateOilPrice}),2)
  798. </update>
  799. <select id="getLinePathLength" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  800. select LINE_PATH_LENGTH "linePathLength" from RMS_LINE where LINE_ID = #{lineId}
  801. </select>
  802. <select id="getPriceValueList" resultType="java.util.LinkedHashMap">
  803. select a_t_price.PRICE_ID "priceId",
  804. a_t_price.PRICE_VALUE "priceValue",
  805. a_t_price.OILPRICE_BASE "oilpriceBase",
  806. a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold",
  807. a_t_price.CARGONAME_ID "cargonameId"
  808. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  809. where a_t_price.OIL_TYPE_ID = #{oilTypeId} and a_t_price.DELETED = 0
  810. </select>
  811. <select id="getPriceValueAndPriceTonKilometer" resultType="java.util.LinkedHashMap">
  812. select a_t_price.PRICE_ID "priceId",
  813. a_t_price.PRICE_VALUE "priceValue",
  814. a_t_price.PRICE_TON_KILOMETER "priceTonKilometer"
  815. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  816. </select>
  817. <update id="updatePriceTonKilometer" parameterType="java.math.BigDecimal">
  818. update AMS_CONTRACT_TRANSPORT_PRICE set PRICE_TON_KILOMETER = #{priceTonKilometer}
  819. where PRICE_ID = #{priceId}
  820. </update>
  821. <select id="getTruckFormula" parameterType="DECIMAL" resultType="java.lang.String">
  822. SELECT FORMULA_STRING
  823. FROM BMSTRUCK_FORMULA
  824. WHERE FORMULA_ID = #{formulaId}
  825. </select>
  826. <select id="getCargonameValue" parameterType="java.math.BigDecimal" resultType="java.lang.String">
  827. select CARGONAME_VALUE "cargonameValue"
  828. from RMS_CARGONAME where CARGONAME_ID = #{cargonameId}
  829. </select>
  830. <select id="getCargoName" resultType="java.util.LinkedHashMap">
  831. select
  832. CARGONAME_ID "id",
  833. CARGONAME_ID "value",
  834. CARGONAME_VALUE "label"
  835. from RMS_CARGONAME
  836. </select>
  837. <select id="getOilTypeName" resultType="java.util.LinkedHashMap">
  838. select
  839. OIL_TYPE_ID "id",
  840. OIL_TYPE_ID "value",
  841. OIL_TYPE_NAME "label"
  842. from RMS_OIL_TYPE
  843. </select>
  844. <select id="getRealAddressByLike" parameterType="java.util.Map" resultType="java.util.Map">
  845. SELECT
  846. RRP.PLACE_ID AS "placeId",
  847. RRP.ADDRESS_DELIVERY_ADDRESS AS "value",
  848. RRP.ADDRESS_DELIVERY_ADDRESS AS "placeName"
  849. FROM RMS_RECEIVE_PLACE RRP
  850. WHERE RRP.ADDRESS_ID = #{addressId}
  851. <if test="index != null">
  852. AND RRP.ADDRESS_DELIVERY_ADDRESS LIKE #{index}
  853. </if>
  854. </select>
  855. <select id="selectFormulaId" parameterType="DECIMAL" resultType="DECIMAL" >
  856. SELECT ACTP.CARGONAME_ID AS "formulaId"
  857. FROM AMS_CONTRACT_TRANSPORT_PRICE ACTP
  858. WHERE ACTP.PRICE_ID = #{priceId}
  859. </select>
  860. <select id="getInwardContractPrice" resultType="java.util.Map" parameterType="java.util.Map">
  861. SELECT *
  862. FROM (SELECT a_t_price.PRICE_ID "priceId",
  863. r_o_type.OIL_TYPE_NAME "oilTypeName",
  864. r_c_type.CAPACITY_TYPE_NAME "capacityTypeName",
  865. a_t_price.PRICE_VALUE "priceValue",
  866. a_t_price.PRICE_DATE "priceDate",
  867. a_t_price.OILPRICE_BASE "oilpriceBase",
  868. a_t_price.INSERT_TIME "insertTime",
  869. a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold",
  870. RGR.TRANS_RANGE_VALUE "transRange",
  871. a_t_price.TYPE "type"
  872. FROM AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  873. LEFT JOIN RMS_RECEIVE_PLACE rrp
  874. ON a_t_price.PLACE_ID = rrp.PLACE_ID
  875. LEFT JOIN RMS_RECEIVE_ADDRESS r_r_address
  876. ON rrp.ADDRESS_ID = r_r_address.ADDRESS_ID
  877. LEFT JOIN RMS_CAPACITY_TYPE r_c_type
  878. ON a_t_price.CAPACITY_TYPE_ID = r_c_type.CAPACITY_TYPE_ID
  879. LEFT JOIN RMS_CARRIER r_carrier
  880. ON a_t_price.CARRIER_ID = r_carrier.CARRIER_ID
  881. LEFT JOIN RMS_TRANS_RANGE RGR
  882. ON a_t_price.LINE_ID = RGR.TRANS_RANGE_ID
  883. LEFT JOIN RMS_OIL_TYPE r_o_type
  884. ON a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
  885. where TYPE in (2,5,6)
  886. <if test="deleted != null">
  887. and a_t_price.DELETED = #{deleted}
  888. </if> )
  889. </select>
  890. <select id="selectInwardPrice" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
  891. select * from (select
  892. distinct
  893. actp.price_id "priceId", actp.price_value "priceValue" ,actp.PRICE_DATE "priceDate"
  894. from ams_contract_transport_price actp
  895. left join ams_contaact_price_material acpm
  896. on acpm.price_id = actp.price_id
  897. left join rms_trans_range rtr
  898. on rtr.trans_range_id = actp.line_id
  899. where type = #{type}
  900. and actp.DELETED = 0
  901. <if test="rangeId != null">
  902. and actp.LINE_ID = #{rangeId}
  903. </if>
  904. <if test="materialId != null">
  905. and acpm.MATERIAL_ID = #{materialTypeId}
  906. </if>
  907. <if test="capacityTypeId != null">
  908. and actp.CAPACITY_TYPE_ID = #{capacityTypeId}
  909. </if>
  910. )
  911. Order by "priceDate" desc
  912. </select>
  913. <select id="getRangePoint" resultType="java.util.Map" parameterType="java.util.Map">
  914. SELECT * FROM
  915. (SELECT RTR.TRANS_RANGE_VALUE "transRangeValue" ,
  916. RLNP.LOAD_POINT_NAME "loadPointName" ,
  917. RLNP.UNLOAD_POINT_NAME "unloadPointName",
  918. RTR.TRANS_RANGE_ID "transRangeId",
  919. RLNP.LINE_NODE_ID "lineNodeId" FROM RMS_TRANS_RANGE RTR
  920. LEFT JOIN RMS_LINE_NODE_POINT RLNP on RTR.TRANS_RANGE_ID = RLNP.TRANS_RANGE_ID
  921. where RLNP.DELETED = 0
  922. <if test="con != null">
  923. AND
  924. RTR.TRANS_RANGE_VALUE||RLNP.LOAD_POINT_NAME||RLNP.UNLOAD_POINT_NAME like #{con}
  925. </if>
  926. )
  927. <where>
  928. <if test="transRangeValue != null">
  929. and
  930. <foreach collection="transRangeValue" item="item" open="(" separator="or" close=")">
  931. "transRangeValue" like '%${item}%'
  932. </foreach>
  933. </if>
  934. <if test="loadPointName != null">
  935. and
  936. <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
  937. "loadPointName" like '%${item}%'
  938. </foreach>
  939. </if>
  940. <if test="loadPointName != null">
  941. and
  942. <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
  943. "loadPointName" like '%${item}%'
  944. </foreach>
  945. </if>
  946. </where>
  947. </select>
  948. </mapper>