AmsContractTruckPriceMapper.xml 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  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. <sql id="whereLikeForeach">
  180. <where>
  181. <if test="priceId != null">
  182. <foreach collection="priceId" item="item" open="(" separator="or" close=")">
  183. "priceId" = '${item}'
  184. </foreach>
  185. </if>
  186. <if test="oilTypeName != null">
  187. and
  188. <foreach collection="oilTypeName" item="item" open="(" separator="or" close=")">
  189. "oilTypeName" = '${item}'
  190. </foreach>
  191. </if>
  192. <if test="capacityTypeName != null">
  193. and
  194. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  195. "capacityTypeName" = '${item}'
  196. </foreach>
  197. </if>
  198. <if test="priceValue != null">
  199. and
  200. <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
  201. "priceValue" = '${item}'
  202. </foreach>
  203. </if>
  204. <if test="priceDate != null">
  205. and
  206. <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
  207. TO_CHAR("priceDate",'yyyy-mm-dd hh24:mi:ss') = '${item}'
  208. </foreach>
  209. </if>
  210. <if test="oilpriceBase != null">
  211. and
  212. <foreach collection="oilpriceBase" item="item" open="(" separator="or" close=")">
  213. "oilpriceBase" = '${item}'
  214. </foreach>
  215. </if>
  216. <if test="insertTime != null">
  217. and
  218. <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
  219. TO_CHAR("insertTime",'yyyy-mm-dd hh24:mi:ss') = '${item}'
  220. </foreach>
  221. </if>
  222. <if test="oilpriceChangeThreshold != null">
  223. and
  224. <foreach collection="oilpriceChangeThreshold" item="item" open="(" separator="or" close=")">
  225. "oilpriceChangeThreshold" = '${item}'
  226. </foreach>
  227. </if>
  228. <if test="transRange != null">
  229. and
  230. <foreach collection="transRange" item="item" open="(" separator="or" close=")">
  231. "transRange" = '${item}'
  232. </foreach>
  233. </if>
  234. <if test="type != null">
  235. and
  236. <foreach collection="type" item="item" open="(" separator="or" close=")">
  237. <if test="item=='元/吨'">
  238. "type" = '2'
  239. </if>
  240. <if test="item=='元/小时'">
  241. "type" = '5'
  242. </if>
  243. <if test="item=='元/趟'">
  244. "type" = '6'
  245. </if>
  246. </foreach>
  247. </if>
  248. </where>
  249. </sql>
  250. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  251. delete from AMS_CONTRACT_TRANSPORT_PRICE
  252. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  253. </delete>
  254. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  255. delete from AMS_CONTRACT_TRANSPORT_PRICE
  256. where 1!=1
  257. <if test="shipperId != null">
  258. or SHIPPER_ID = #{shipperId}
  259. </if>
  260. <if test="carrierId != null">
  261. or CARRIER_ID = #{carrierId}
  262. </if>
  263. <if test="lineId != null">
  264. or LINE_ID = #{lineId}
  265. </if>
  266. <if test="capacityTypeId != null">
  267. or CAPACITY_TYPE_ID = #{capacityTypeId}
  268. </if>
  269. <if test="cargonameId != null">
  270. or CARGONAME_ID = #{cargonameId}
  271. </if>
  272. <if test="priceTonKilometer != null">
  273. or PRICE_TON_KILOMETER = #{priceTonKilometer}
  274. </if>
  275. <if test="priceValue != null">
  276. or PRICE_VALUE = #{priceValue}
  277. </if>
  278. <if test="priceDate != null">
  279. or TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = '#{priceDate}'
  280. </if>
  281. <if test="insertUsername != null and insertUsername != ''">
  282. or INSERT_USERNAME = #{insertUsername}
  283. </if>
  284. <if test="insertTime != null">
  285. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  286. </if>
  287. <if test="updateUsername != null and updateUsername != ''">
  288. or UPDATE_USERNAME = #{updateUsername}
  289. </if>
  290. <if test="updateTime != null">
  291. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  292. </if>
  293. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  294. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  295. </if>
  296. <if test="deleted != null">
  297. or DELETED = #{deleted}
  298. </if>
  299. <if test="placeId != null">
  300. or PLACE_ID = #{placeId}
  301. </if>
  302. <if test="type != null">
  303. or TYPE = #{type}
  304. </if>
  305. <if test="department != null">
  306. or DEPARTMENT = #{department}
  307. </if>
  308. <if test="oilpriceBase != null">
  309. or OILPRICE_BASE = #{oilpriceBase}
  310. </if>
  311. <if test="oilTypeId != null">
  312. or OIL_TYPE_ID = #{oilTypeId}
  313. </if>
  314. <if test="oilpriceChangeThreshold != null">
  315. or OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
  316. </if>
  317. </delete>
  318. <insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  319. insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
  320. LINE_ID, CAPACITY_TYPE_ID, CARGONAME_ID,
  321. PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE,
  322. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  323. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  324. PLACE_ID, TYPE, DEPARTMENT,
  325. OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD
  326. )
  327. values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
  328. #{lineId,jdbcType=DECIMAL}, #{capacityTypeId,jdbcType=DECIMAL}, #{cargonameId,jdbcType=DECIMAL},
  329. #{priceTonKilometer,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL}, #{priceDate,jdbcType=TIMESTAMP},
  330. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  331. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  332. #{placeId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL},
  333. #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL}
  334. )
  335. </insert>
  336. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  337. insert into AMS_CONTRACT_TRANSPORT_PRICE
  338. <trim prefix="(" suffix=")" suffixOverrides=",">
  339. <if test="priceId != null">
  340. PRICE_ID,
  341. </if>
  342. <if test="shipperId != null">
  343. SHIPPER_ID,
  344. </if>
  345. <if test="carrierId != null">
  346. CARRIER_ID,
  347. </if>
  348. <if test="lineId != null">
  349. LINE_ID,
  350. </if>
  351. <if test="capacityTypeId != null">
  352. CAPACITY_TYPE_ID,
  353. </if>
  354. <if test="cargonameId != null">
  355. CARGONAME_ID,
  356. </if>
  357. <if test="priceTonKilometer != null">
  358. PRICE_TON_KILOMETER,
  359. </if>
  360. <if test="priceValue != null">
  361. PRICE_VALUE,
  362. </if>
  363. <if test="priceDate != null">
  364. PRICE_DATE,
  365. </if>
  366. <if test="insertUsername != null">
  367. INSERT_USERNAME,
  368. </if>
  369. <if test="insertTime != null">
  370. INSERT_TIME,
  371. </if>
  372. <if test="updateUsername != null">
  373. UPDATE_USERNAME,
  374. </if>
  375. <if test="updateTime != null">
  376. UPDATE_TIME,
  377. </if>
  378. <if test="insertUpdateRemark != null">
  379. INSERT_UPDATE_REMARK,
  380. </if>
  381. <if test="deleted != null">
  382. DELETED,
  383. </if>
  384. <if test="placeId != null">
  385. PLACE_ID,
  386. </if>
  387. <if test="type != null">
  388. TYPE,
  389. </if>
  390. <if test="department != null">
  391. DEPARTMENT,
  392. </if>
  393. <if test="oilpriceBase != null">
  394. OILPRICE_BASE,
  395. </if>
  396. <if test="oilTypeId != null">
  397. OIL_TYPE_ID,
  398. </if>
  399. <if test="oilpriceChangeThreshold != null">
  400. OILPRICE_CHANGE_THRESHOLD,
  401. </if>
  402. </trim>
  403. <trim prefix="values (" suffix=")" suffixOverrides=",">
  404. <if test="priceId != null">
  405. #{priceId,jdbcType=DECIMAL},
  406. </if>
  407. <if test="shipperId != null">
  408. #{shipperId,jdbcType=DECIMAL},
  409. </if>
  410. <if test="carrierId != null">
  411. #{carrierId,jdbcType=DECIMAL},
  412. </if>
  413. <if test="lineId != null">
  414. #{lineId,jdbcType=DECIMAL},
  415. </if>
  416. <if test="capacityTypeId != null">
  417. #{capacityTypeId,jdbcType=DECIMAL},
  418. </if>
  419. <if test="cargonameId != null">
  420. #{cargonameId,jdbcType=DECIMAL},
  421. </if>
  422. <if test="priceTonKilometer != null">
  423. #{priceTonKilometer,jdbcType=DECIMAL},
  424. </if>
  425. <if test="priceValue != null">
  426. #{priceValue,jdbcType=DECIMAL},
  427. </if>
  428. <if test="priceDate != null">
  429. #{priceDate,jdbcType=TIMESTAMP},
  430. </if>
  431. <if test="insertUsername != null">
  432. #{insertUsername,jdbcType=VARCHAR},
  433. </if>
  434. <if test="insertTime != null">
  435. #{insertTime,jdbcType=TIMESTAMP},
  436. </if>
  437. <if test="updateUsername != null">
  438. #{updateUsername,jdbcType=VARCHAR},
  439. </if>
  440. <if test="updateTime != null">
  441. #{updateTime,jdbcType=TIMESTAMP},
  442. </if>
  443. <if test="insertUpdateRemark != null">
  444. #{insertUpdateRemark,jdbcType=VARCHAR},
  445. </if>
  446. <if test="deleted != null">
  447. #{deleted,jdbcType=DECIMAL},
  448. </if>
  449. <if test="placeId != null">
  450. #{placeId,jdbcType=DECIMAL},
  451. </if>
  452. <if test="type != null">
  453. #{type,jdbcType=DECIMAL},
  454. </if>
  455. <if test="department != null">
  456. #{department,jdbcType=DECIMAL},
  457. </if>
  458. <if test="oilpriceBase != null">
  459. #{oilpriceBase,jdbcType=DECIMAL},
  460. </if>
  461. <if test="oilTypeId != null">
  462. #{oilTypeId,jdbcType=DECIMAL},
  463. </if>
  464. <if test="oilpriceChangeThreshold != null">
  465. #{oilpriceChangeThreshold,jdbcType=DECIMAL},
  466. </if>
  467. </trim>
  468. </insert>
  469. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  470. update AMS_CONTRACT_TRANSPORT_PRICE
  471. set SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  472. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  473. LINE_ID = #{lineId,jdbcType=DECIMAL},
  474. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  475. CARGONAME_ID = #{cargonameId,jdbcType=DECIMAL},
  476. PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
  477. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  478. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  479. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  480. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  481. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  482. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  483. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  484. DELETED = #{deleted,jdbcType=DECIMAL},
  485. PLACE_ID = #{placeId,jdbcType=DECIMAL},
  486. TYPE = #{type,jdbcType=DECIMAL},
  487. DEPARTMENT = #{department,jdbcType=DECIMAL},
  488. OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
  489. OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
  490. OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL}
  491. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  492. </update>
  493. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
  494. update AMS_CONTRACT_TRANSPORT_PRICE
  495. <set>
  496. <if test="shipperId != null">
  497. SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
  498. </if>
  499. <if test="carrierId != null">
  500. CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
  501. </if>
  502. <if test="lineId != null">
  503. LINE_ID = #{lineId,jdbcType=DECIMAL},
  504. </if>
  505. <if test="capacityTypeId != null">
  506. CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
  507. </if>
  508. <if test="cargonameId != null">
  509. CARGONAME_ID = #{cargonameId,jdbcType=DECIMAL},
  510. </if>
  511. <if test="priceTonKilometer != null">
  512. PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
  513. </if>
  514. <if test="priceValue != null">
  515. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  516. </if>
  517. <if test="priceDate != null">
  518. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  519. </if>
  520. <if test="insertUsername != null">
  521. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  522. </if>
  523. <if test="insertTime != null">
  524. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  525. </if>
  526. <if test="updateUsername != null">
  527. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  528. </if>
  529. <if test="updateTime != null">
  530. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  531. </if>
  532. <if test="insertUpdateRemark != null">
  533. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  534. </if>
  535. <if test="deleted != null">
  536. DELETED = #{deleted,jdbcType=DECIMAL},
  537. </if>
  538. <if test="placeId != null">
  539. PLACE_ID = #{placeId,jdbcType=DECIMAL},
  540. </if>
  541. <if test="type != null">
  542. TYPE = #{type,jdbcType=DECIMAL},
  543. </if>
  544. <if test="department != null">
  545. DEPARTMENT = #{department,jdbcType=DECIMAL},
  546. </if>
  547. <if test="oilpriceBase != null">
  548. OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
  549. </if>
  550. <if test="oilTypeId != null">
  551. OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
  552. </if>
  553. <if test="oilpriceChangeThreshold != null">
  554. OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
  555. </if>
  556. </set>
  557. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  558. </update>
  559. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  560. <include refid="select" />
  561. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  562. </select>
  563. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  564. <include refid="select" />
  565. <include refid="where" />
  566. </select>
  567. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  568. <include refid="select" />
  569. <include refid="whereLike" />
  570. </select>
  571. <insert id="batchInsert" parameterType="java.util.List">
  572. insert into AMS_CONTRACT_TRANSPORT_PRICE
  573. (PRICE_ID,
  574. SHIPPER_ID, CARRIER_ID, LINE_ID,
  575. CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER,
  576. PRICE_VALUE, PRICE_DATE, INSERT_USERNAME,
  577. INSERT_TIME, UPDATE_USERNAME,
  578. UPDATE_TIME, INSERT_UPDATE_REMARK,
  579. DELETED, PLACE_ID, TYPE,
  580. DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
  581. OILPRICE_CHANGE_THRESHOLD)
  582. ( <foreach collection="list" item="item" separator="union all">
  583. select
  584. #{item.priceId,jdbcType=DECIMAL},
  585. #{item.shipperId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.lineId,jdbcType=DECIMAL},
  586. #{item.capacityTypeId,jdbcType=DECIMAL}, #{item.cargonameId,jdbcType=DECIMAL}, #{item.priceTonKilometer,jdbcType=DECIMAL},
  587. #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
  588. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  589. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  590. #{item.deleted,jdbcType=DECIMAL}, #{item.placeId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL},
  591. #{item.department,jdbcType=DECIMAL}, #{item.oilpriceBase,jdbcType=DECIMAL}, #{item.oilTypeId,jdbcType=DECIMAL},
  592. #{item.oilpriceChangeThreshold,jdbcType=DECIMAL} from dual
  593. </foreach> )
  594. </insert>
  595. <update id="batchUpdate" parameterType="java.util.List">
  596. update AMS_CONTRACT_TRANSPORT_PRICE
  597. set
  598. PRICE_ID=
  599. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  600. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
  601. </foreach>
  602. ,SHIPPER_ID=
  603. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  604. when #{item.priceId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
  605. </foreach>
  606. ,CARRIER_ID=
  607. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  608. when #{item.priceId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
  609. </foreach>
  610. ,LINE_ID=
  611. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  612. when #{item.priceId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  613. </foreach>
  614. ,CAPACITY_TYPE_ID=
  615. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  616. when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
  617. </foreach>
  618. ,CARGONAME_ID=
  619. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  620. when #{item.priceId,jdbcType=DECIMAL} then #{item.cargonameId,jdbcType=DECIMAL}
  621. </foreach>
  622. ,PRICE_TON_KILOMETER=
  623. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  624. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceTonKilometer,jdbcType=DECIMAL}
  625. </foreach>
  626. ,PRICE_VALUE=
  627. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  628. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
  629. </foreach>
  630. ,PRICE_DATE=
  631. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  632. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
  633. </foreach>
  634. ,INSERT_USERNAME=
  635. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  636. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  637. </foreach>
  638. ,INSERT_TIME=
  639. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  640. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  641. </foreach>
  642. ,UPDATE_USERNAME=
  643. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  644. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  645. </foreach>
  646. ,UPDATE_TIME=
  647. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  648. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  649. </foreach>
  650. ,INSERT_UPDATE_REMARK=
  651. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  652. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  653. </foreach>
  654. ,DELETED=
  655. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  656. when #{item.priceId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  657. </foreach>
  658. ,PLACE_ID=
  659. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  660. when #{item.priceId,jdbcType=DECIMAL} then #{item.placeId,jdbcType=DECIMAL}
  661. </foreach>
  662. ,TYPE=
  663. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  664. when #{item.priceId,jdbcType=DECIMAL} then #{item.type,jdbcType=DECIMAL}
  665. </foreach>
  666. ,DEPARTMENT=
  667. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  668. when #{item.priceId,jdbcType=DECIMAL} then #{item.department,jdbcType=DECIMAL}
  669. </foreach>
  670. ,OILPRICE_BASE=
  671. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  672. when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceBase,jdbcType=DECIMAL}
  673. </foreach>
  674. ,OIL_TYPE_ID=
  675. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  676. when #{item.priceId,jdbcType=DECIMAL} then #{item.oilTypeId,jdbcType=DECIMAL}
  677. </foreach>
  678. ,OILPRICE_CHANGE_THRESHOLD=
  679. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  680. when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceChangeThreshold,jdbcType=DECIMAL}
  681. </foreach>
  682. where PRICE_ID in
  683. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  684. #{item.priceId,jdbcType=DECIMAL}
  685. </foreach>
  686. </update>
  687. <delete id="batchDelete" parameterType="java.util.List">
  688. delete from AMS_CONTRACT_TRANSPORT_PRICE
  689. where PRICE_ID in
  690. <foreach close=")" collection="list" item="id" open="(" separator=",">
  691. #{id}
  692. </foreach>
  693. </delete>
  694. <!-- 友情提示!!!-->
  695. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  696. <select id="getAmsContractTransportPrice" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  697. select * from(
  698. select a_t_price.PRICE_ID "priceId",
  699. r_r_address.ADDRESS_PROVINCE "addressProvince",
  700. r_r_address.ADDRESS_DISTRICT "addressDistrict",
  701. r_r_address.ADDRESS_TOWN "addressTown",
  702. rrp.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
  703. r_carrier.CARRIER_NAME "carrierName",
  704. r_line.LINE_PATH_LENGTH "linePathLength",
  705. r_o_type.OIL_TYPE_NAME "oilTypeName",
  706. r_c_type.CAPACITY_TYPE_NAME "capacityTypeName",
  707. a_t_price.PRICE_VALUE "priceValue",
  708. a_t_price.PRICE_TON_KILOMETER "priceTonKilometer",
  709. a_t_price.PRICE_DATE "priceDate",
  710. a_t_price.OILPRICE_BASE "oilpriceBase",
  711. a_t_price.INSERT_TIME "insertTime",
  712. rs.SHIPPER_NAME "shipperName",
  713. a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold"
  714. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  715. left join RMS_RECEIVE_PLACE rrp
  716. on a_t_price.PLACE_ID=rrp.PLACE_ID
  717. left join RMS_RECEIVE_ADDRESS r_r_address
  718. on rrp.ADDRESS_ID = r_r_address.ADDRESS_ID
  719. left join RMS_CAPACITY_TYPE r_c_type
  720. on a_t_price.CAPACITY_TYPE_ID=r_c_type.CAPACITY_TYPE_ID
  721. left join RMS_CARRIER r_carrier
  722. on a_t_price.CARRIER_ID=r_carrier.CARRIER_ID
  723. left join RMS_LINE r_line
  724. on a_t_price.LINE_ID=r_line.LINE_ID
  725. left join RMS_OIL_TYPE r_o_type
  726. on a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
  727. left join RMS_SHIPPER rs
  728. on rs.SHIPPER_ID = a_t_price.SHIPPER_ID
  729. -- where a_t_price.DELETED = 0
  730. -- and a_t_price.TYPE = 1 and a_t_price.DEPARTMENT = 2
  731. <where>
  732. <if test="deleted != null">
  733. and a_t_price.DELETED = #{deleted}
  734. </if>
  735. <if test="con !=null and con != ''.toString()">
  736. and
  737. r_r_address.ADDRESS_PROVINCE || r_r_address.ADDRESS_DISTRICT || r_r_address.ADDRESS_TOWN
  738. || rrp.ADDRESS_DELIVERY_ADDRESS || r_carrier.CARRIER_NAME || r_c_type.CAPACITY_TYPE_NAME
  739. like CONCAT('%',CONCAT(#{con},'%'))
  740. </if>
  741. </where>
  742. )
  743. <where>
  744. <if test="addressProvince != null">
  745. and
  746. <foreach collection="addressProvince" item="item" open="(" separator="or" close=")">
  747. "addressProvince" like '%${item}%'
  748. </foreach>
  749. </if>
  750. <if test="shipperName != null">
  751. and
  752. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  753. "shipperName" like '%${item}%'
  754. </foreach>
  755. </if>
  756. <if test="addressDistrict != null">
  757. and
  758. <foreach collection="addressDistrict" item="item" open="(" separator="or" close=")">
  759. "addressDistrict" like '%${item}%'
  760. </foreach>
  761. </if>
  762. <if test="addressTown != null">
  763. and
  764. <foreach collection="addressTown" item="item" open="(" separator="or" close=")">
  765. "addressTown" like '%${item}%'
  766. </foreach>
  767. </if>
  768. <if test="addressDeliveryAddress != null">
  769. and
  770. <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
  771. "addressDeliveryAddress" like '%${item}%'
  772. </foreach>
  773. </if>
  774. <if test="linePathLength != null">
  775. and
  776. <foreach collection="linePathLength" item="item" open="(" separator="or" close=")">
  777. "linePathLength" like '%${item}%'
  778. </foreach>
  779. </if>
  780. <if test="carrierName != null">
  781. and
  782. <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
  783. "carrierName" like '%${item}%'
  784. </foreach>
  785. </if>
  786. <if test="capacityTypeName != null">
  787. and
  788. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  789. "capacityTypeName" like '%${item}%'
  790. </foreach>
  791. </if>
  792. <if test="priceValue != null">
  793. and
  794. <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
  795. "priceValue" like '%${item}%'
  796. </foreach>
  797. </if>
  798. <if test="priceTonKilometer != null">
  799. and
  800. <foreach collection="priceTonKilometer" item="item" open="(" separator="or" close=")">
  801. "priceTonKilometer" like '%${item}%'
  802. </foreach>
  803. </if>
  804. <if test="priceDate != null">
  805. and
  806. <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
  807. "priceDate" like '%${item}%'
  808. </foreach>
  809. </if>
  810. </where>
  811. <include refid="orderBy"></include>
  812. <if test="orderField == null ">
  813. order by "priceDate" desc
  814. </if>
  815. </select>
  816. <sql id="orderBy">
  817. <if test="orderField != null and orderField != ''">
  818. order by "${orderField}"
  819. <if test="orderType != null and orderType != ''">
  820. ${orderType}
  821. </if>
  822. </if>
  823. </sql>
  824. <select id="getCarrierName" resultType="java.util.LinkedHashMap">
  825. select
  826. CARRIER_ID "id",
  827. CARRIER_ID "value",
  828. CARRIER_NAME "label"
  829. from RMS_CARRIER
  830. </select>
  831. <select id="getLineNo" resultType="java.util.LinkedHashMap">
  832. select
  833. LINE_ID "id",
  834. LINE_ID "value",
  835. LINE_NO "label"
  836. from RMS_LINE
  837. </select>
  838. <select id="getCapacityNumber" resultType="java.util.LinkedHashMap">
  839. select
  840. CAPACITY_ID "id",
  841. CAPACITY_ID "value",
  842. CAPACITY_NUMBER "label"
  843. from RMS_CAPACITY
  844. </select>
  845. <select id="getAddressDeliveryAddress" resultType="java.util.LinkedHashMap">
  846. SELECT *
  847. FROM (SELECT
  848. distinct
  849. RRA.ADDRESS_ID "addressId",
  850. RRA.ADDRESS_PROVINCE "province",
  851. RRA.ADDRESS_DISTRICT "district",
  852. RRA.ADDRESS_TOWN "town",
  853. RRP.ADDRESS_DELIVERY_ADDRESS "address1",
  854. RRA.ADDRESS_PROVINCE ||RRA.ADDRESS_DISTRICT|| RRA.ADDRESS_TOWN||RRP.ADDRESS_DELIVERY_ADDRESS "address",
  855. ACTP.PRICE_VALUE "pricevalue",
  856. ACTP.PRICE_ID "priceid"
  857. FROM RMS_RECEIVE_ADDRESS RRA
  858. LEFT JOIN RMS_RECEIVE_PLACE RRP
  859. ON RRP.ADDRESS_ID=RRA.ADDRESS_ID
  860. LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE ACTP
  861. ON ACTP.PLACE_ID=RRP.PLACE_ID
  862. ) RRRA
  863. <if test="con != null" >
  864. WHERE RRRA."address" LIKE #{con}
  865. </if>
  866. order by RRRA."pricevalue" asc nulls last
  867. </select>
  868. <select id="selectByPriceId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
  869. select a_t_price.SHIPPER_ID "shipperId",
  870. a_t_price.CARRIER_ID "carrierId",
  871. a_t_price.LINE_ID "lineId",
  872. a_t_price.CAPACITY_ID "capacityId",
  873. a_t_price.MATERIAL_ID "materialId",
  874. a_t_price.PLACE_ID "placeId",
  875. a_t_price.PRICE_VALUE "priceValue",
  876. a_t_price.PRICE_DATE "priceDate"
  877. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  878. where a_t_price.PRICE_ID = #{priceId}
  879. </select>
  880. <select id="getOriginAndNowOilPrice" resultType="java.util.LinkedHashMap">
  881. select rownum "rownum",
  882. r_o_price.PRICE_VALUE "priceValue"
  883. from RMS_OIL_PRICE r_o_price where r_o_price.PRICE_OIL_NAME='0号柴油'
  884. order by r_o_price.PRICE_DATE desc
  885. </select>
  886. <update id="batchUpdateTransportPriceByOilPrice" parameterType="double">
  887. update AMS_CONTRACT_TRANSPORT_PRICE
  888. set PRICE_VALUE = ROUND(PRICE_VALUE * 0.65 + PRICE_VALUE * 0.35 * (1 + #{updateOilPrice}),2)
  889. </update>
  890. <select id="getLinePathLength" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  891. select LINE_PATH_LENGTH "linePathLength" from RMS_LINE where LINE_ID = #{lineId}
  892. </select>
  893. <select id="getPriceValueList" resultType="java.util.LinkedHashMap">
  894. select a_t_price.PRICE_ID "priceId",
  895. a_t_price.PRICE_VALUE "priceValue",
  896. a_t_price.OILPRICE_BASE "oilpriceBase",
  897. a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold",
  898. a_t_price.CARGONAME_ID "cargonameId"
  899. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  900. where a_t_price.OIL_TYPE_ID = #{oilTypeId} and a_t_price.DELETED = 0
  901. </select>
  902. <select id="getPriceValueAndPriceTonKilometer" resultType="java.util.LinkedHashMap">
  903. select a_t_price.PRICE_ID "priceId",
  904. a_t_price.PRICE_VALUE "priceValue",
  905. a_t_price.PRICE_TON_KILOMETER "priceTonKilometer"
  906. from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  907. </select>
  908. <update id="updatePriceTonKilometer" parameterType="java.math.BigDecimal">
  909. update AMS_CONTRACT_TRANSPORT_PRICE set PRICE_TON_KILOMETER = #{priceTonKilometer}
  910. where PRICE_ID = #{priceId}
  911. </update>
  912. <select id="getTruckFormula" parameterType="DECIMAL" resultType="java.lang.String">
  913. SELECT FORMULA_STRING
  914. FROM BMSTRUCK_FORMULA
  915. WHERE FORMULA_ID = #{formulaId}
  916. </select>
  917. <select id="getCargonameValue" parameterType="java.math.BigDecimal" resultType="java.lang.String">
  918. select CARGONAME_VALUE "cargonameValue"
  919. from RMS_CARGONAME where CARGONAME_ID = #{cargonameId}
  920. </select>
  921. <select id="getCargoName" resultType="java.util.LinkedHashMap">
  922. select
  923. CARGONAME_ID "id",
  924. CARGONAME_ID "value",
  925. CARGONAME_VALUE "label"
  926. from RMS_CARGONAME
  927. </select>
  928. <select id="getOilTypeName" resultType="java.util.LinkedHashMap">
  929. select
  930. OIL_TYPE_ID "id",
  931. OIL_TYPE_ID "value",
  932. OIL_TYPE_NAME "label"
  933. from RMS_OIL_TYPE
  934. </select>
  935. <select id="getRealAddressByLike" parameterType="java.util.Map" resultType="java.util.Map">
  936. SELECT
  937. RRP.PLACE_ID AS "placeId",
  938. RRP.ADDRESS_DELIVERY_ADDRESS AS "value",
  939. RRP.ADDRESS_DELIVERY_ADDRESS AS "placeName"
  940. FROM RMS_RECEIVE_PLACE RRP
  941. WHERE RRP.ADDRESS_ID = #{addressId}
  942. <if test="index != null">
  943. AND RRP.ADDRESS_DELIVERY_ADDRESS LIKE #{index}
  944. </if>
  945. </select>
  946. <select id="selectFormulaId" parameterType="DECIMAL" resultType="DECIMAL" >
  947. SELECT ACTP.CARGONAME_ID AS "formulaId"
  948. FROM AMS_CONTRACT_TRANSPORT_PRICE ACTP
  949. WHERE ACTP.PRICE_ID = #{priceId}
  950. </select>
  951. <select id="getInwardContractPrice" resultType="java.util.Map" parameterType="java.util.Map">
  952. SELECT *
  953. FROM (SELECT a_t_price.PRICE_ID "priceId",
  954. r_o_type.OIL_TYPE_NAME "oilTypeName",
  955. r_c_type.CAPACITY_TYPE_NAME "capacityTypeName",
  956. a_t_price.PRICE_VALUE "priceValue",
  957. a_t_price.PRICE_DATE "priceDate",
  958. a_t_price.OILPRICE_BASE "oilpriceBase",
  959. a_t_price.INSERT_TIME "insertTime",
  960. a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold",
  961. RGR.TRANS_RANGE_VALUE "transRange",
  962. a_t_price.TYPE "type"
  963. FROM AMS_CONTRACT_TRANSPORT_PRICE a_t_price
  964. LEFT JOIN RMS_RECEIVE_PLACE rrp
  965. ON a_t_price.PLACE_ID = rrp.PLACE_ID
  966. LEFT JOIN RMS_RECEIVE_ADDRESS r_r_address
  967. ON rrp.ADDRESS_ID = r_r_address.ADDRESS_ID
  968. LEFT JOIN RMS_CAPACITY_TYPE r_c_type
  969. ON a_t_price.CAPACITY_TYPE_ID = r_c_type.CAPACITY_TYPE_ID
  970. LEFT JOIN RMS_CARRIER r_carrier
  971. ON a_t_price.CARRIER_ID = r_carrier.CARRIER_ID
  972. LEFT JOIN RMS_TRANS_RANGE RGR
  973. ON a_t_price.LINE_ID = RGR.TRANS_RANGE_ID
  974. LEFT JOIN RMS_OIL_TYPE r_o_type
  975. ON a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
  976. where TYPE in (2,5,6)
  977. <if test="deleted != null">
  978. and a_t_price.DELETED = #{deleted}
  979. </if>
  980. <if test="con != null" >
  981. and RGR.TRANS_RANGE_VALUE LIKE #{con}
  982. </if>)
  983. <include refid="whereLikeForeach"/>
  984. <include refid="orderBy"></include>
  985. </select>
  986. <select id="selectInwardPrice" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
  987. select * from (select
  988. distinct
  989. actp.price_id "priceId", actp.price_value "priceValue" ,actp.PRICE_DATE "priceDate"
  990. from ams_contract_transport_price actp
  991. left join ams_contaact_price_material acpm
  992. on acpm.price_id = actp.price_id
  993. left join rms_trans_range rtr
  994. on rtr.trans_range_id = actp.line_id
  995. where type = #{type}
  996. and actp.DELETED = 0
  997. and acpm.DELETED = 0
  998. <if test="rangeId != null">
  999. and actp.LINE_ID = #{rangeId}
  1000. </if>
  1001. <if test="materialId != null">
  1002. and acpm.MATERIAL_ID = #{materialTypeId}
  1003. </if>
  1004. <if test="capacityTypeId != null">
  1005. and actp.CAPACITY_TYPE_ID = #{capacityTypeId}
  1006. </if>
  1007. )
  1008. Order by "priceDate" desc
  1009. </select>
  1010. <select id="getRangePoint" resultType="java.util.Map" parameterType="java.util.Map">
  1011. SELECT * FROM
  1012. (SELECT RTR.TRANS_RANGE_VALUE "transRangeValue" ,
  1013. RLNP.LOAD_POINT_NAME "loadPointName" ,
  1014. RLNP.UNLOAD_POINT_NAME "unloadPointName",
  1015. RTR.TRANS_RANGE_ID "transRangeId",
  1016. RLNP.LINE_NODE_ID "lineNodeId" FROM RMS_TRANS_RANGE RTR
  1017. LEFT JOIN RMS_LINE_NODE_POINT RLNP on RTR.TRANS_RANGE_ID = RLNP.TRANS_RANGE_ID
  1018. where RLNP.DELETED = 0
  1019. <if test="con != null">
  1020. AND
  1021. RTR.TRANS_RANGE_VALUE||RLNP.LOAD_POINT_NAME||RLNP.UNLOAD_POINT_NAME like #{con}
  1022. </if>
  1023. )
  1024. <where>
  1025. <if test="transRangeValue != null">
  1026. and
  1027. <foreach collection="transRangeValue" item="item" open="(" separator="or" close=")">
  1028. "transRangeValue" like '%${item}%'
  1029. </foreach>
  1030. </if>
  1031. <if test="loadPointName != null">
  1032. and
  1033. <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
  1034. "loadPointName" like '%${item}%'
  1035. </foreach>
  1036. </if>
  1037. <if test="loadPointName != null">
  1038. and
  1039. <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
  1040. "loadPointName" like '%${item}%'
  1041. </foreach>
  1042. </if>
  1043. </where>
  1044. </select>
  1045. <select id="selectwz" resultType="java.util.Map">
  1046. select
  1047. RMT.MATERIAL_TYPE_NAME "materialName",
  1048. RMT.MATERIAL_TYPE_ID "materialId"
  1049. from AMS_CONTAACT_PRICE_MATERIAL acpr
  1050. left join RMS_MATERIAL_TYPE RMT
  1051. on RMT.MATERIAL_TYPE_ID = acpr.MATERIAL_ID
  1052. where
  1053. RMT.MATERIAL_ISINWARD = 1
  1054. AND
  1055. PRICE_ID = #{priceId}
  1056. AND ACPR.DELETED = 0
  1057. </select>
  1058. <select id="getcargonameId" resultType="java.util.Map">
  1059. select
  1060. BF.FORMULA_ID AS "formulaId",
  1061. BF.FORMULA_NAME AS "formulaName",
  1062. BF.FORMULA_STRING AS "formulaString"
  1063. from AMS_CONTRACT_TRANSPORT_PRICE t
  1064. left join BMSTRUCK_FORMULA bf on t.cargoname_id=bf.formula_id
  1065. where price_id=#{priceId}
  1066. </select>
  1067. </mapper>