|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yijia.station.mapper.StationOilPriceAdjustMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="StationOilPriceAdjust" id="StationOilPriceAdjustResult">
|
|
|
<result property="adjustPriceId" column="adjust_price_id" />
|
|
|
<result property="oilName" column="oil_name" />
|
|
@@ -18,42 +18,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="oilPriceId" column="oil_price_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <sql id="selectStationOilPriceAdjustVo">
|
|
|
- select adjust_price_id, oil_name, oil_adjust_price, take_effect_status, take_effect_date, adjust_date, station_id, station_name, operator, status, oil_price_id from station_oil_price_adjust
|
|
|
- </sql>
|
|
|
-
|
|
|
<select id="selectStationOilPriceAdjustList" parameterType="StationOilPriceAdjust" resultMap="StationOilPriceAdjustResult">
|
|
|
- <include refid="selectStationOilPriceAdjustVo"/>
|
|
|
- <where>
|
|
|
- <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
|
|
|
- <if test="oilAdjustPrice != null and oilAdjustPrice != ''"> and oil_adjust_price = #{oilAdjustPrice}</if>
|
|
|
- <if test="takeEffectStatus != null and takeEffectStatus != ''"> and take_effect_status = #{takeEffectStatus}</if>
|
|
|
- <if test="takeEffectDate != null "> and take_effect_date = #{takeEffectDate}</if>
|
|
|
- <if test="adjustDate != null "> and adjust_date = #{adjustDate}</if>
|
|
|
- <if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
- <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
|
|
|
- <if test="operator != null and operator != ''"> and operator = #{operator}</if>
|
|
|
- <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
- <if test="oilPriceId != null "> and oil_price_id = #{oilPriceId}</if>
|
|
|
+ select a.adjust_price_id, a.oil_name, a.oil_adjust_price, a.take_effect_status, a.take_effect_date, a.adjust_date, a.station_id, d.dept_name as station_name,a.operator,
|
|
|
+ a.oil_price_id,a.status
|
|
|
+ from station_oil_price_adjust a join sys_dept d on a.station_id =d.dept_id
|
|
|
+ <where>
|
|
|
+ <if test="oilName != null and oilName != ''"> and a.oil_name like concat('%', #{oilName}, '%')</if>
|
|
|
+ <if test="oilAdjustPrice != null and oilAdjustPrice != ''"> and a.oil_adjust_price = #{oilAdjustPrice}</if>
|
|
|
+ <if test="takeEffectStatus != null and takeEffectStatus != ''"> and a.take_effect_status = #{takeEffectStatus}</if>
|
|
|
+ <if test="takeEffectDate != null "> and a.take_effect_date = #{takeEffectDate}</if>
|
|
|
+ <if test="adjustDate != null "> and a.adjust_date = #{adjustDate}</if>
|
|
|
+ <if test="stationId != null "> and a.station_id = #{stationId}</if>
|
|
|
+ <if test="oilPriceId != null "> and a.oil_price_id = #{oilPriceId}</if>
|
|
|
+ <if test="status != null "> and a.status = #{status}</if>
|
|
|
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
|
|
|
- AND date_format(take_effect_date,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
|
|
+ AND date_format(a.take_effect_date,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
|
|
</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
- and station_id in
|
|
|
+ and a.station_id in
|
|
|
<foreach item="item" index="index" collection="stationIdList"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by adjust_price_id desc
|
|
|
+ order by a.adjust_price_id desc
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectStationOilPriceAdjustById" parameterType="Long" resultMap="StationOilPriceAdjustResult">
|
|
|
- <include refid="selectStationOilPriceAdjustVo"/>
|
|
|
- where adjust_price_id = #{adjustPriceId}
|
|
|
+ select a.adjust_price_id, a.oil_name, a.oil_adjust_price, a.take_effect_status, a.take_effect_date, a.adjust_date, a.station_id, d.dept_name as station_name,a.operator,
|
|
|
+ a.oil_price_id,a.status
|
|
|
+ from station_oil_price_adjust a join sys_dept d on a.station_id =d.dept_id
|
|
|
+ where a.adjust_price_id = #{adjustPriceId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertStationOilPriceAdjust" parameterType="StationOilPriceAdjust" useGeneratedKeys="true" keyProperty="adjustPriceId">
|
|
|
insert into station_oil_price_adjust
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -63,10 +61,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="takeEffectDate != null">take_effect_date,</if>
|
|
|
<if test="adjustDate != null">adjust_date,</if>
|
|
|
<if test="stationId != null">station_id,</if>
|
|
|
- <if test="stationName != null">station_name,</if>
|
|
|
<if test="operator != null">operator,</if>
|
|
|
- <if test="status != null">status,</if>
|
|
|
<if test="oilPriceId != null">oil_price_id,</if>
|
|
|
+ <if test="status != null "> status,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="oilName != null">#{oilName},</if>
|
|
@@ -75,10 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="takeEffectDate != null">#{takeEffectDate},</if>
|
|
|
<if test="adjustDate != null">#{adjustDate},</if>
|
|
|
<if test="stationId != null">#{stationId},</if>
|
|
|
- <if test="stationName != null">#{stationName},</if>
|
|
|
<if test="operator != null">#{operator},</if>
|
|
|
- <if test="status != null">#{status},</if>
|
|
|
<if test="oilPriceId != null">#{oilPriceId},</if>
|
|
|
+ <if test="status != null "> #{status},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -91,9 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="takeEffectDate != null">take_effect_date = #{takeEffectDate},</if>
|
|
|
<if test="adjustDate != null">adjust_date = #{adjustDate},</if>
|
|
|
<if test="stationId != null">station_id = #{stationId},</if>
|
|
|
- <if test="stationName != null">station_name = #{stationName},</if>
|
|
|
<if test="operator != null">operator = #{operator},</if>
|
|
|
- <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="status != null "> status = #{status},</if>
|
|
|
<if test="oilPriceId != null">oil_price_id = #{oilPriceId},</if>
|
|
|
</trim>
|
|
|
where adjust_price_id = #{adjustPriceId}
|
|
@@ -104,10 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteStationOilPriceAdjustByIds" parameterType="String">
|
|
|
- delete from station_oil_price_adjust where adjust_price_id in
|
|
|
+ delete from station_oil_price_adjust where adjust_price_id in
|
|
|
<foreach item="adjustPriceId" collection="array" open="(" separator="," close=")">
|
|
|
#{adjustPriceId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|