RmsOilPriceMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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.RmsOilPriceMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsOilPrice">
  5. <id column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
  6. <result column="PRICE_OIL_NAME" jdbcType="VARCHAR" property="priceOilName" />
  7. <result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
  8. <result column="PRICE_DATE" jdbcType="TIMESTAMP" property="priceDate" />
  9. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  10. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  11. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  12. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  13. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  14. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  15. <result column="PRICE_STATUS" jdbcType="DECIMAL" property="priceStatus" />
  16. <result column="FLOATING_SCALE" jdbcType="DECIMAL" property="floatingScale" />
  17. </resultMap>
  18. <sql id="columns">
  19. PRICE_ID, PRICE_OIL_NAME, PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME,
  20. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PRICE_STATUS, FLOATING_SCALE
  21. </sql>
  22. <sql id="columns_alias">
  23. t.PRICE_ID, t.PRICE_OIL_NAME, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, t.INSERT_TIME,
  24. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PRICE_STATUS,
  25. t.FLOATING_SCALE
  26. </sql>
  27. <sql id="select">
  28. SELECT <include refid="columns" /> FROM RMS_OIL_PRICE
  29. </sql>
  30. <sql id="select_alias">
  31. SELECT <include refid="columns_alias" /> FROM RMS_OIL_PRICE t
  32. </sql>
  33. <sql id="where">
  34. <where>
  35. <if test="priceId != null">
  36. and PRICE_ID = #{priceId}
  37. </if>
  38. <if test="priceOilName != null and priceOilName != ''">
  39. and PRICE_OIL_NAME = #{priceOilName}
  40. </if>
  41. <if test="priceValue != null">
  42. and PRICE_VALUE = #{priceValue}
  43. </if>
  44. <if test="priceDate != null">
  45. and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
  46. </if>
  47. <if test="insertUsername != null and insertUsername != ''">
  48. and INSERT_USERNAME = #{insertUsername}
  49. </if>
  50. <if test="insertTime != null">
  51. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  52. </if>
  53. <if test="updateUsername != null and updateUsername != ''">
  54. and UPDATE_USERNAME = #{updateUsername}
  55. </if>
  56. <if test="updateTime != null">
  57. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  58. </if>
  59. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  60. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  61. </if>
  62. <if test="deleted != null">
  63. and DELETED = #{deleted}
  64. </if>
  65. <if test="priceStatus != null">
  66. and PRICE_STATUS = #{priceStatus}
  67. </if>
  68. <if test="floatingScale != null">
  69. and FLOATING_SCALE = #{floatingScale}
  70. </if>
  71. </where>
  72. </sql>
  73. <sql id="whereLike">
  74. <where>
  75. <if test="priceId != null">
  76. and PRICE_ID = #{priceId}
  77. </if>
  78. <if test="priceOilName != null and priceOilName != ''">
  79. and PRICE_OIL_NAME LIKE '%${priceOilName}%'
  80. </if>
  81. <if test="priceValue != null">
  82. and PRICE_VALUE = #{priceValue}
  83. </if>
  84. <if test="priceDate != null">
  85. and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
  86. </if>
  87. <if test="insertUsername != null and insertUsername != ''">
  88. and INSERT_USERNAME LIKE '%${insertUsername}%'
  89. </if>
  90. <if test="insertTime != null">
  91. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  92. </if>
  93. <if test="updateUsername != null and updateUsername != ''">
  94. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  95. </if>
  96. <if test="updateTime != null">
  97. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  98. </if>
  99. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  100. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  101. </if>
  102. <if test="deleted != null">
  103. and DELETED = #{deleted}
  104. </if>
  105. <if test="priceStatus != null">
  106. and PRICE_STATUS = #{priceStatus}
  107. </if>
  108. <if test="floatingScale != null">
  109. and FLOATING_SCALE = #{floatingScale}
  110. </if>
  111. </where>
  112. </sql>
  113. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  114. delete from RMS_OIL_PRICE
  115. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  116. </delete>
  117. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  118. delete from RMS_OIL_PRICE
  119. where 1!=1
  120. <if test="priceOilName != null and priceOilName != ''">
  121. or PRICE_OIL_NAME = #{priceOilName}
  122. </if>
  123. <if test="priceValue != null">
  124. or PRICE_VALUE = #{priceValue}
  125. </if>
  126. <if test="priceDate != null">
  127. or TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = '#{priceDate}'
  128. </if>
  129. <if test="insertUsername != null and insertUsername != ''">
  130. or INSERT_USERNAME = #{insertUsername}
  131. </if>
  132. <if test="insertTime != null">
  133. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  134. </if>
  135. <if test="updateUsername != null and updateUsername != ''">
  136. or UPDATE_USERNAME = #{updateUsername}
  137. </if>
  138. <if test="updateTime != null">
  139. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  140. </if>
  141. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  142. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  143. </if>
  144. <if test="deleted != null">
  145. or DELETED = #{deleted}
  146. </if>
  147. <if test="priceStatus != null">
  148. or PRICE_STATUS = #{priceStatus}
  149. </if>
  150. <if test="floatingScale != null">
  151. or FLOATING_SCALE = #{floatingScale}
  152. </if>
  153. </delete>
  154. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsOilPrice">
  155. insert into RMS_OIL_PRICE (PRICE_ID, PRICE_OIL_NAME, PRICE_VALUE,
  156. PRICE_DATE, INSERT_USERNAME, INSERT_TIME,
  157. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  158. DELETED, PRICE_STATUS, FLOATING_SCALE
  159. )
  160. values (#{priceId,jdbcType=DECIMAL}, #{priceOilName,jdbcType=VARCHAR}, #{priceValue,jdbcType=DECIMAL},
  161. #{priceDate,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  162. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  163. #{deleted,jdbcType=DECIMAL}, #{priceStatus,jdbcType=DECIMAL}, #{floatingScale,jdbcType=DECIMAL}
  164. )
  165. </insert>
  166. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsOilPrice">
  167. insert into RMS_OIL_PRICE
  168. <trim prefix="(" suffix=")" suffixOverrides=",">
  169. <if test="priceId != null">
  170. PRICE_ID,
  171. </if>
  172. <if test="priceOilName != null">
  173. PRICE_OIL_NAME,
  174. </if>
  175. <if test="priceValue != null">
  176. PRICE_VALUE,
  177. </if>
  178. <if test="priceDate != null">
  179. PRICE_DATE,
  180. </if>
  181. <if test="insertUsername != null">
  182. INSERT_USERNAME,
  183. </if>
  184. <if test="insertTime != null">
  185. INSERT_TIME,
  186. </if>
  187. <if test="updateUsername != null">
  188. UPDATE_USERNAME,
  189. </if>
  190. <if test="updateTime != null">
  191. UPDATE_TIME,
  192. </if>
  193. <if test="insertUpdateRemark != null">
  194. INSERT_UPDATE_REMARK,
  195. </if>
  196. <if test="deleted != null">
  197. DELETED,
  198. </if>
  199. <if test="priceStatus != null">
  200. PRICE_STATUS,
  201. </if>
  202. <if test="floatingScale != null">
  203. FLOATING_SCALE,
  204. </if>
  205. </trim>
  206. <trim prefix="values (" suffix=")" suffixOverrides=",">
  207. <if test="priceId != null">
  208. #{priceId,jdbcType=DECIMAL},
  209. </if>
  210. <if test="priceOilName != null">
  211. #{priceOilName,jdbcType=VARCHAR},
  212. </if>
  213. <if test="priceValue != null">
  214. #{priceValue,jdbcType=DECIMAL},
  215. </if>
  216. <if test="priceDate != null">
  217. #{priceDate,jdbcType=TIMESTAMP},
  218. </if>
  219. <if test="insertUsername != null">
  220. #{insertUsername,jdbcType=VARCHAR},
  221. </if>
  222. <if test="insertTime != null">
  223. #{insertTime,jdbcType=TIMESTAMP},
  224. </if>
  225. <if test="updateUsername != null">
  226. #{updateUsername,jdbcType=VARCHAR},
  227. </if>
  228. <if test="updateTime != null">
  229. #{updateTime,jdbcType=TIMESTAMP},
  230. </if>
  231. <if test="insertUpdateRemark != null">
  232. #{insertUpdateRemark,jdbcType=VARCHAR},
  233. </if>
  234. <if test="deleted != null">
  235. #{deleted,jdbcType=DECIMAL},
  236. </if>
  237. <if test="priceStatus != null">
  238. #{priceStatus,jdbcType=DECIMAL},
  239. </if>
  240. <if test="floatingScale != null">
  241. #{floatingScale,jdbcType=DECIMAL},
  242. </if>
  243. </trim>
  244. </insert>
  245. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsOilPrice">
  246. update RMS_OIL_PRICE
  247. set PRICE_OIL_NAME = #{priceOilName,jdbcType=VARCHAR},
  248. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  249. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  250. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  251. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  252. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  253. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  254. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  255. DELETED = #{deleted,jdbcType=DECIMAL},
  256. PRICE_STATUS = #{priceStatus,jdbcType=DECIMAL},
  257. FLOATING_SCALE = #{floatingScale,jdbcType=DECIMAL}
  258. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  259. </update>
  260. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsOilPrice">
  261. update RMS_OIL_PRICE
  262. <set>
  263. <if test="priceOilName != null">
  264. PRICE_OIL_NAME = #{priceOilName,jdbcType=VARCHAR},
  265. </if>
  266. <if test="priceValue != null">
  267. PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
  268. </if>
  269. <if test="priceDate != null">
  270. PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
  271. </if>
  272. <if test="insertUsername != null">
  273. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  274. </if>
  275. <if test="insertTime != null">
  276. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  277. </if>
  278. <if test="updateUsername != null">
  279. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  280. </if>
  281. <if test="updateTime != null">
  282. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  283. </if>
  284. <if test="insertUpdateRemark != null">
  285. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  286. </if>
  287. <if test="deleted != null">
  288. DELETED = #{deleted,jdbcType=DECIMAL},
  289. </if>
  290. <if test="priceStatus != null">
  291. PRICE_STATUS = #{priceStatus,jdbcType=DECIMAL},
  292. </if>
  293. <if test="floatingScale != null">
  294. FLOATING_SCALE = #{floatingScale,jdbcType=DECIMAL},
  295. </if>
  296. </set>
  297. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  298. </update>
  299. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  300. <include refid="select" />
  301. where PRICE_ID = #{priceId,jdbcType=DECIMAL}
  302. </select>
  303. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  304. <include refid="select" />
  305. <include refid="where" />
  306. </select>
  307. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  308. <include refid="select" />
  309. <include refid="whereLike" />
  310. </select>
  311. <insert id="batchInsert" parameterType="java.util.List">
  312. insert into RMS_OIL_PRICE
  313. (PRICE_ID,
  314. PRICE_OIL_NAME, PRICE_VALUE, PRICE_DATE,
  315. INSERT_USERNAME, INSERT_TIME,
  316. UPDATE_USERNAME, UPDATE_TIME,
  317. INSERT_UPDATE_REMARK, DELETED,
  318. PRICE_STATUS, FLOATING_SCALE)
  319. ( <foreach collection="list" item="item" separator="union all">
  320. select
  321. #{item.priceId,jdbcType=DECIMAL},
  322. #{item.priceOilName,jdbcType=VARCHAR}, #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP},
  323. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  324. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  325. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  326. #{item.priceStatus,jdbcType=DECIMAL}, #{item.floatingScale,jdbcType=DECIMAL} from dual
  327. </foreach> )
  328. </insert>
  329. <update id="batchUpdate" parameterType="java.util.List">
  330. update RMS_OIL_PRICE
  331. set
  332. PRICE_ID=
  333. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  334. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
  335. </foreach>
  336. ,PRICE_OIL_NAME=
  337. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  338. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceOilName,jdbcType=VARCHAR}
  339. </foreach>
  340. ,PRICE_VALUE=
  341. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  342. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
  343. </foreach>
  344. ,PRICE_DATE=
  345. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  346. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
  347. </foreach>
  348. ,INSERT_USERNAME=
  349. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  350. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  351. </foreach>
  352. ,INSERT_TIME=
  353. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  354. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  355. </foreach>
  356. ,UPDATE_USERNAME=
  357. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  358. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  359. </foreach>
  360. ,UPDATE_TIME=
  361. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  362. when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  363. </foreach>
  364. ,INSERT_UPDATE_REMARK=
  365. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  366. when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  367. </foreach>
  368. ,DELETED=
  369. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  370. when #{item.priceId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  371. </foreach>
  372. ,PRICE_STATUS=
  373. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  374. when #{item.priceId,jdbcType=DECIMAL} then #{item.priceStatus,jdbcType=DECIMAL}
  375. </foreach>
  376. ,FLOATING_SCALE=
  377. <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
  378. when #{item.priceId,jdbcType=DECIMAL} then #{item.floatingScale,jdbcType=DECIMAL}
  379. </foreach>
  380. where PRICE_ID in
  381. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  382. #{item.priceId,jdbcType=DECIMAL}
  383. </foreach>
  384. </update>
  385. <delete id="batchDelete" parameterType="java.util.List">
  386. delete from RMS_OIL_PRICE
  387. where PRICE_ID in
  388. <foreach close=")" collection="list" item="id" open="(" separator=",">
  389. #{id}
  390. </foreach>
  391. </delete>
  392. <!-- 友情提示!!!-->
  393. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  394. <!-- 油价列表 -->
  395. <select id="getOilPriceList" parameterType="java.util.Map" resultType="java.util.Map">
  396. SELECT * FROM
  397. (
  398. SELECT
  399. ROP.PRICE_ID AS "priceId",
  400. ROT.OIL_TYPE_NAME AS "priceOilName",
  401. ROP.PRICE_VALUE AS "priceValue",
  402. ROP.PRICE_DATE AS "priceDate",
  403. ROP.FLOATING_SCALE "floatingScale",
  404. (case when ROP.PRICE_STATUS = 0
  405. then '启用'
  406. when ROP.PRICE_STATUS = 1
  407. then '停用'
  408. end ) "priceStatus"
  409. FROM RMS_OIL_PRICE ROP
  410. left join RMS_OIL_TYPE ROT
  411. on ROP.PRICE_OIL_NAME = ROT.OIL_TYPE_ID
  412. WHERE ROP.DELETED = 0
  413. ORDER BY ROP.INSERT_TIME DESC
  414. )
  415. <where>
  416. <if test="priceId!= null">
  417. <foreach collection="priceId" item="item" open="(" separator="," close=")">
  418. "priceId" in #{item}
  419. </foreach>
  420. </if>
  421. <if test="priceOilName!= null">
  422. and
  423. <foreach collection="priceOilName" item="item" open="(" separator="," close=")">
  424. "priceOilName" in #{item}
  425. </foreach>
  426. </if>
  427. <if test="priceValue!= null">
  428. and
  429. <foreach collection="priceValue" item="item" open="(" separator="," close=")">
  430. "priceValue" in #{item}
  431. </foreach>
  432. </if>
  433. <if test="priceDate!= null">
  434. and
  435. <foreach collection="priceDate" item="item" open="(" separator="," close=")">
  436. "priceDate" in #{item}
  437. </foreach>
  438. </if>
  439. <if test="floatingScale!= null">
  440. and
  441. <foreach collection="floatingScale" item="item" open="(" separator="," close=")">
  442. "floatingScale" in #{item}
  443. </foreach>
  444. </if>
  445. <if test="priceStatus!= null">
  446. and
  447. <foreach collection="priceStatus" item="item" open="(" separator="," close=")">
  448. "priceStatus" in #{item}
  449. </foreach>
  450. </if>
  451. </where>
  452. <include refid="orderBy"></include>
  453. </select>
  454. <sql id="orderBy">
  455. <if test="orderField!=null and orderField !=''">
  456. order by "${orderField}"
  457. <if test="orderType !=null and orderType !=''">
  458. ${orderType}
  459. </if>
  460. </if>
  461. </sql>
  462. <!--根据Id查询油价-->
  463. <select id="getOilPriceById" resultType="java.util.LinkedHashMap" >
  464. SELECT
  465. ROP.PRICE_ID AS "priceId",
  466. ROP.PRICE_OIL_NAME AS "priceOilName",
  467. ROP.PRICE_VALUE AS "priceValue",
  468. ROP.PRICE_DATE AS "priceDate"
  469. FROM RMS_OIL_PRICE ROP
  470. WHERE ROP.PRICE_ID=#{id}
  471. </select>
  472. <!-- 通过油品ID获取上一次油品价格 -->
  473. <select id="getLastOilPrice" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  474. select ROP.PRICE_VALUE "priceValue",
  475. ROP.PRICE_ID "priceId"
  476. from RMS_OIL_PRICE ROP
  477. where ROP.PRICE_OIL_NAME = #{oilNameId}
  478. and ROP.DELETED = 0
  479. and ROP.PRICE_STATUS = 0
  480. </select>
  481. </mapper>