|
@@ -3,7 +3,7 @@
|
|
|
<mapper namespace="com.steerinfo.dil.mapper.RmsOilPriceMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsOilPrice">
|
|
|
<id column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
|
|
|
- <result column="PRICE_OIL_NAME" jdbcType="VARCHAR" property="priceOilName" />
|
|
|
+ <result column="PRICE_OIL_TYPE_ID" jdbcType="DECIMAL" property="priceOilTypeId" />
|
|
|
<result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
|
|
|
<result column="PRICE_DATE" jdbcType="TIMESTAMP" property="priceDate" />
|
|
|
<result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
|
|
@@ -16,13 +16,13 @@
|
|
|
<result column="FLOATING_SCALE" jdbcType="DECIMAL" property="floatingScale" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
- PRICE_ID, PRICE_OIL_NAME, PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME,
|
|
|
+ PRICE_ID, PRICE_OIL_TYPE_ID, PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME,
|
|
|
UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PRICE_STATUS, FLOATING_SCALE
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
- t.PRICE_ID, t.PRICE_OIL_NAME, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, t.INSERT_TIME,
|
|
|
- t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PRICE_STATUS,
|
|
|
- t.FLOATING_SCALE
|
|
|
+ t.PRICE_ID, t.PRICE_OIL_TYPE_ID, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME,
|
|
|
+ t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
|
|
|
+ t.PRICE_STATUS, t.FLOATING_SCALE
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
SELECT <include refid="columns" /> FROM RMS_OIL_PRICE
|
|
@@ -35,8 +35,8 @@
|
|
|
<if test="priceId != null">
|
|
|
and PRICE_ID = #{priceId}
|
|
|
</if>
|
|
|
- <if test="priceOilName != null and priceOilName != ''">
|
|
|
- and PRICE_OIL_NAME = #{priceOilName}
|
|
|
+ <if test="priceOilTypeId != null">
|
|
|
+ and PRICE_OIL_TYPE_ID = #{priceOilTypeId}
|
|
|
</if>
|
|
|
<if test="priceValue != null">
|
|
|
and PRICE_VALUE = #{priceValue}
|
|
@@ -75,8 +75,8 @@
|
|
|
<if test="priceId != null">
|
|
|
and PRICE_ID = #{priceId}
|
|
|
</if>
|
|
|
- <if test="priceOilName != null and priceOilName != ''">
|
|
|
- and PRICE_OIL_NAME LIKE '%${priceOilName}%'
|
|
|
+ <if test="priceOilTypeId != null">
|
|
|
+ and PRICE_OIL_TYPE_ID = #{priceOilTypeId}
|
|
|
</if>
|
|
|
<if test="priceValue != null">
|
|
|
and PRICE_VALUE = #{priceValue}
|
|
@@ -117,8 +117,8 @@
|
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
delete from RMS_OIL_PRICE
|
|
|
where 1!=1
|
|
|
- <if test="priceOilName != null and priceOilName != ''">
|
|
|
- or PRICE_OIL_NAME = #{priceOilName}
|
|
|
+ <if test="priceOilTypeId != null">
|
|
|
+ or PRICE_OIL_TYPE_ID = #{priceOilTypeId}
|
|
|
</if>
|
|
|
<if test="priceValue != null">
|
|
|
or PRICE_VALUE = #{priceValue}
|
|
@@ -152,12 +152,12 @@
|
|
|
</if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.RmsOilPrice">
|
|
|
- insert into RMS_OIL_PRICE (PRICE_ID, PRICE_OIL_NAME, PRICE_VALUE,
|
|
|
+ insert into RMS_OIL_PRICE (PRICE_ID, PRICE_OIL_TYPE_ID, PRICE_VALUE,
|
|
|
PRICE_DATE, INSERT_USERNAME, INSERT_TIME,
|
|
|
UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
DELETED, PRICE_STATUS, FLOATING_SCALE
|
|
|
)
|
|
|
- values (#{priceId,jdbcType=DECIMAL}, #{priceOilName,jdbcType=VARCHAR}, #{priceValue,jdbcType=DECIMAL},
|
|
|
+ values (#{priceId,jdbcType=DECIMAL}, #{priceOilTypeId,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL},
|
|
|
#{priceDate,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
#{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
#{deleted,jdbcType=DECIMAL}, #{priceStatus,jdbcType=DECIMAL}, #{floatingScale,jdbcType=DECIMAL}
|
|
@@ -169,8 +169,8 @@
|
|
|
<if test="priceId != null">
|
|
|
PRICE_ID,
|
|
|
</if>
|
|
|
- <if test="priceOilName != null">
|
|
|
- PRICE_OIL_NAME,
|
|
|
+ <if test="priceOilTypeId != null">
|
|
|
+ PRICE_OIL_TYPE_ID,
|
|
|
</if>
|
|
|
<if test="priceValue != null">
|
|
|
PRICE_VALUE,
|
|
@@ -207,8 +207,8 @@
|
|
|
<if test="priceId != null">
|
|
|
#{priceId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
- <if test="priceOilName != null">
|
|
|
- #{priceOilName,jdbcType=VARCHAR},
|
|
|
+ <if test="priceOilTypeId != null">
|
|
|
+ #{priceOilTypeId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="priceValue != null">
|
|
|
#{priceValue,jdbcType=DECIMAL},
|
|
@@ -244,7 +244,7 @@
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsOilPrice">
|
|
|
update RMS_OIL_PRICE
|
|
|
- set PRICE_OIL_NAME = #{priceOilName,jdbcType=VARCHAR},
|
|
|
+ set PRICE_OIL_TYPE_ID = #{priceOilTypeId,jdbcType=DECIMAL},
|
|
|
PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
|
|
|
PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
|
|
|
INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
@@ -260,8 +260,8 @@
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsOilPrice">
|
|
|
update RMS_OIL_PRICE
|
|
|
<set>
|
|
|
- <if test="priceOilName != null">
|
|
|
- PRICE_OIL_NAME = #{priceOilName,jdbcType=VARCHAR},
|
|
|
+ <if test="priceOilTypeId != null">
|
|
|
+ PRICE_OIL_TYPE_ID = #{priceOilTypeId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="priceValue != null">
|
|
|
PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
|
|
@@ -311,7 +311,7 @@
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
insert into RMS_OIL_PRICE
|
|
|
(PRICE_ID,
|
|
|
- PRICE_OIL_NAME, PRICE_VALUE, PRICE_DATE,
|
|
|
+ PRICE_OIL_TYPE_ID, PRICE_VALUE, PRICE_DATE,
|
|
|
INSERT_USERNAME, INSERT_TIME,
|
|
|
UPDATE_USERNAME, UPDATE_TIME,
|
|
|
INSERT_UPDATE_REMARK, DELETED,
|
|
@@ -319,7 +319,7 @@
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.priceId,jdbcType=DECIMAL},
|
|
|
- #{item.priceOilName,jdbcType=VARCHAR}, #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP},
|
|
|
+ #{item.priceOilTypeId,jdbcType=DECIMAL}, #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP},
|
|
|
#{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
|
#{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
#{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
|
|
@@ -333,9 +333,9 @@
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
|
|
|
when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
- ,PRICE_OIL_NAME=
|
|
|
+ ,PRICE_OIL_TYPE_ID=
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
|
|
|
- when #{item.priceId,jdbcType=DECIMAL} then #{item.priceOilName,jdbcType=VARCHAR}
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.priceOilTypeId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
,PRICE_VALUE=
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
|
|
@@ -409,7 +409,7 @@
|
|
|
end ) "priceStatus"
|
|
|
FROM RMS_OIL_PRICE ROP
|
|
|
left join RMS_OIL_TYPE ROT
|
|
|
- on ROP.PRICE_OIL_NAME = ROT.OIL_TYPE_ID
|
|
|
+ on ROP.PRICE_OIL_TYPE_ID = ROT.OIL_TYPE_ID
|
|
|
WHERE ROP.DELETED = 0
|
|
|
ORDER BY ROP.INSERT_TIME DESC
|
|
|
)
|
|
@@ -465,12 +465,14 @@
|
|
|
|
|
|
|
|
|
<!--根据Id查询油价-->
|
|
|
- <select id="getOilPriceById" resultType="java.util.LinkedHashMap" >
|
|
|
+ <select id="getOilPriceById" parameterType="map" resultType="java.util.LinkedHashMap" >
|
|
|
SELECT
|
|
|
ROP.PRICE_ID AS "priceId",
|
|
|
- ROP.PRICE_OIL_NAME AS "priceOilName",
|
|
|
- ROP.PRICE_VALUE AS "priceValue",
|
|
|
- ROP.PRICE_DATE AS "priceDate"
|
|
|
+ ROP.PRICE_OIL_TYPE_ID AS "oilTypeId", --批量修改运输单价
|
|
|
+ ROP.PRICE_VALUE AS "newOilPrice", --批量修改运输单价
|
|
|
+ ROP.PRICE_DATE AS "priceDate",
|
|
|
+ ROP.PRICE_STATUS "priceStatus",
|
|
|
+ ROP.FLOATING_SCALE "floatingScale"
|
|
|
FROM RMS_OIL_PRICE ROP
|
|
|
WHERE ROP.PRICE_ID=#{id}
|
|
|
|
|
@@ -481,7 +483,7 @@
|
|
|
select ROP.PRICE_VALUE "priceValue",
|
|
|
ROP.PRICE_ID "priceId"
|
|
|
from RMS_OIL_PRICE ROP
|
|
|
- where ROP.PRICE_OIL_NAME = #{oilNameId}
|
|
|
+ where ROP.PRICE_OIL_TYPE_ID = #{oilNameId}
|
|
|
and ROP.DELETED = 0
|
|
|
and ROP.PRICE_STATUS = 0
|
|
|
</select>
|