|
@@ -3,21 +3,13 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yijia.market.mapper.MarkertPlanMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="MarkertPlan" id="MarkertPlanResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="grade" column="grade" />
|
|
|
<result property="discountTerm" column="discount_term" />
|
|
|
<result property="discountAmt" column="discount_amt" />
|
|
|
<result property="gasoilDiscountAmt" column="gasoil_discount_amt" />
|
|
|
- <result property="activityDaySetting" column="activity_day_setting" />
|
|
|
- <result property="activityDayType" column="activity_day_type" />
|
|
|
- <result property="activityDayWeek" column="activity_day_week" />
|
|
|
- <result property="activityDayMonth" column="activity_day_month" />
|
|
|
- <result property="activityDayDate" column="activity_day_date" />
|
|
|
- <result property="activityDayTime" column="activity_day_time" />
|
|
|
- <result property="activityDayDistnct" column="activity_day_distnct" />
|
|
|
- <result property="dieseloilDiscountAmt" column="dieseloil_discount_amt" />
|
|
|
<result property="vipDiscountyPlus" column="vip_discounty_plus" />
|
|
|
<result property="couponPlus" column="coupon_plus" />
|
|
|
<result property="discountPlanType" column="discount_plan_type" />
|
|
@@ -25,34 +17,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="stationId" column="station_id" />
|
|
|
<result property="stationName" column="station_name" />
|
|
|
<result property="status" column="status" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectMarkertPlanVo">
|
|
|
- select id, grade, discount_term, discount_amt, gasoil_discount_amt, dieseloil_discount_amt, vip_discounty_plus, coupon_plus, discount_plan_type, oil_name, station_id, station_name, status from markert_plan
|
|
|
+ select id, grade, discount_term, discount_amt, gasoil_discount_amt, dieseloil_discount_amt, vip_discounty_plus, coupon_plus, discount_plan_type,
|
|
|
+ oil_name, station_id, station_name, status,create_by,create_time,update_by,update_time
|
|
|
+ from markert_plan
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectMarkertPlanList" parameterType="MarkertPlan" resultMap="MarkertPlanResult">
|
|
|
- <include refid="selectMarkertPlanVo"/>
|
|
|
- <where>
|
|
|
- <if test="grade != null and grade != ''"> and grade = #{grade}</if>
|
|
|
- <if test="discountTerm != null and discountTerm != ''"> and discount_term = #{discountTerm}</if>
|
|
|
- <if test="discountAmt != null and discountAmt != ''"> and discount_amt = #{discountAmt}</if>
|
|
|
- <if test="gasoilDiscountAmt != null and gasoilDiscountAmt != ''"> and gasoil_discount_amt = #{gasoilDiscountAmt}</if>
|
|
|
- <if test="activityDaySetting != null and activityDaySetting != ''"> and activity_day_setting = #{activityDaySetting}</if>
|
|
|
- <if test="activityDayType != null and activityDayType != ''"> and activity_day_type = #{activityDayType}</if>
|
|
|
- <if test="activityDayWeek != null and activityDayWeek != ''"> and activity_day_week = #{activityDayWeek}</if>
|
|
|
- <if test="activityDayMonth != null and activityDayMonth != ''"> and activity_day_month = #{activityDayMonth}</if>
|
|
|
- <if test="activityDayDate != null and activityDayDate != ''"> and activity_day_date = #{activityDayDate}</if>
|
|
|
- <if test="activityDayTime != null and activityDayTime != ''"> and activity_day_time = #{activityDayTime}</if>
|
|
|
- <if test="activityDayDistnct != null and activityDayDistnct != ''"> and activity_day_distnct = #{activityDayDistnct}</if>
|
|
|
- <if test="dieseloilDiscountAmt != null and dieseloilDiscountAmt != ''"> and dieseloil_discount_amt = #{dieseloilDiscountAmt}</if>
|
|
|
- <if test="vipDiscountyPlus != null and vipDiscountyPlus != ''"> and vip_discounty_plus = #{vipDiscountyPlus}</if>
|
|
|
- <if test="couponPlus != null and couponPlus != ''"> and coupon_plus = #{couponPlus}</if>
|
|
|
- <if test="discountPlanType != null and discountPlanType != ''"> and discount_plan_type = #{discountPlanType}</if>
|
|
|
- <if test="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</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="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ select p.id, p.grade, p.discount_term, p.discount_amt, p.gasoil_discount_amt, p.vip_discounty_plus, p.coupon_plus, p.discount_plan_type,
|
|
|
+ p.oil_name, station_id, p.status,p.create_by,p.create_time,p.update_by,p.update_time,d.dept_name as station_name
|
|
|
+ from markert_plan p join sys_dept d on d.dept_id =p.station_id
|
|
|
+ <where>
|
|
|
+ <if test="grade != null and grade != ''"> and p.grade = #{grade}</if>
|
|
|
+ <if test="discountTerm != null and discountTerm != ''"> and p.discount_term = #{discountTerm}</if>
|
|
|
+ <if test="discountAmt != null and discountAmt != ''"> and p.discount_amt = #{discountAmt}</if>
|
|
|
+ <if test="gasoilDiscountAmt != null and gasoilDiscountAmt != ''"> and p.gasoil_discount_amt = #{gasoilDiscountAmt}</if>
|
|
|
+ <if test="vipDiscountyPlus != null and vipDiscountyPlus != ''"> and p.vip_discounty_plus = #{vipDiscountyPlus}</if>
|
|
|
+ <if test="couponPlus != null and couponPlus != ''"> and p.coupon_plus = #{couponPlus}</if>
|
|
|
+ <if test="discountPlanType != null and discountPlanType != ''"> and p.discount_plan_type = #{discountPlanType}</if>
|
|
|
+ <if test="oilName != null and oilName != ''"> and p.oil_name like concat('%', #{oilName}, '%')</if>
|
|
|
+ <if test="stationId != null "> and p.station_id = #{stationId}</if>
|
|
|
+ <if test="status != null and status != ''"> and p.status = #{status}</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
and station_id in
|
|
|
<foreach item="item" index="index" collection="stationIdList"
|
|
@@ -62,12 +53,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectMarkertPlanById" parameterType="Long" resultMap="MarkertPlanResult">
|
|
|
- <include refid="selectMarkertPlanVo"/>
|
|
|
+ select p.id, p.grade, p.discount_term, p.discount_amt, p.gasoil_discount_amt, p.vip_discounty_plus, p.coupon_plus, p.discount_plan_type,
|
|
|
+ p.oil_name, station_id, p.status,p.create_by,p.create_time,p.update_by,p.update_time,d.dept_name as station_name
|
|
|
+ from markert_plan p join sys_dept d on d.dept_id =p.station_id
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertMarkertPlan" parameterType="MarkertPlan" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into markert_plan
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -75,42 +68,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="discountTerm != null">discount_term,</if>
|
|
|
<if test="discountAmt != null">discount_amt,</if>
|
|
|
<if test="gasoilDiscountAmt != null">gasoil_discount_amt,</if>
|
|
|
- <if test="dieseloilDiscountAmt != null">dieseloil_discount_amt,</if>
|
|
|
<if test="vipDiscountyPlus != null">vip_discounty_plus,</if>
|
|
|
<if test="couponPlus != null">coupon_plus,</if>
|
|
|
<if test="discountPlanType != null">discount_plan_type,</if>
|
|
|
<if test="oilName != null">oil_name,</if>
|
|
|
<if test="stationId != null">station_id,</if>
|
|
|
- <if test="stationName != null">station_name,</if>
|
|
|
<if test="status != null">status,</if>
|
|
|
- <if test="activityDaySetting != null ">activity_day_setting,</if>
|
|
|
- <if test="activityDayType != null ">activity_day_type,</if>
|
|
|
- <if test="activityDayWeek != null ">activity_day_week,</if>
|
|
|
- <if test="activityDayMonth != null ">activity_day_month,</if>
|
|
|
- <if test="activityDayDate != null">activity_day_date,</if>
|
|
|
- <if test="activityDayTime != null">activity_day_time,</if>
|
|
|
- <if test="activityDayDistnct != null">activity_day_distnct,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="grade != null">#{grade},</if>
|
|
|
<if test="discountTerm != null">#{discountTerm},</if>
|
|
|
<if test="discountAmt != null">#{discountAmt},</if>
|
|
|
<if test="gasoilDiscountAmt != null">#{gasoilDiscountAmt},</if>
|
|
|
- <if test="dieseloilDiscountAmt != null">#{dieseloilDiscountAmt},</if>
|
|
|
<if test="vipDiscountyPlus != null">#{vipDiscountyPlus},</if>
|
|
|
<if test="couponPlus != null">#{couponPlus},</if>
|
|
|
<if test="discountPlanType != null">#{discountPlanType},</if>
|
|
|
<if test="oilName != null">#{oilName},</if>
|
|
|
<if test="stationId != null">#{stationId},</if>
|
|
|
- <if test="stationName != null">#{stationName},</if>
|
|
|
<if test="status != null">#{status},</if>
|
|
|
- <if test="activityDaySetting != null ">#{activityDaySetting},</if>
|
|
|
- <if test="activityDayType != null ">#{activityDayType},</if>
|
|
|
- <if test="activityDayWeek != null ">#{activityDayWeek},</if>
|
|
|
- <if test="activityDayMonth != null ">#{activityDayMonth},</if>
|
|
|
- <if test="activityDayDate != null">#{activityDayDate},</if>
|
|
|
- <if test="activityDayTime != null">#{activityDayTime},</if>
|
|
|
- <if test="activityDayDistnct != null">#{activityDayDistnct},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -121,21 +104,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="discountTerm != null">discount_term = #{discountTerm},</if>
|
|
|
<if test="discountAmt != null">discount_amt = #{discountAmt},</if>
|
|
|
<if test="gasoilDiscountAmt != null">gasoil_discount_amt = #{gasoilDiscountAmt},</if>
|
|
|
- <if test="dieseloilDiscountAmt != null">dieseloil_discount_amt = #{dieseloilDiscountAmt},</if>
|
|
|
<if test="vipDiscountyPlus != null">vip_discounty_plus = #{vipDiscountyPlus},</if>
|
|
|
<if test="couponPlus != null">coupon_plus = #{couponPlus},</if>
|
|
|
<if test="discountPlanType != null">discount_plan_type = #{discountPlanType},</if>
|
|
|
<if test="oilName != null">oil_name = #{oilName},</if>
|
|
|
<if test="stationId != null">station_id = #{stationId},</if>
|
|
|
- <if test="stationName != null">station_name = #{stationName},</if>
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
- <if test="activityDaySetting != null ">activityDaySetting = #{activityDaySetting},</if>
|
|
|
- <if test="activityDayType != null ">activityDayType= #{activityDayType},</if>
|
|
|
- <if test="activityDayWeek != null ">activityDayWeek = #{activityDayWeek},</if>
|
|
|
- <if test="activityDayMonth != null "> activityDayMonth = #{activityDayMonth},</if>
|
|
|
- <if test="activityDayDate != null">activityDayDate = #{activityDayDate},</if>
|
|
|
- <if test="activityDayTime != null">activityDayTime = #{activityDayTime},</if>
|
|
|
- <if test="activityDayDistnct != null">activityDayDistnct = #{activityDayDistnct},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -145,10 +123,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteMarkertPlanByIds" parameterType="String">
|
|
|
- delete from markert_plan where id in
|
|
|
+ delete from markert_plan where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|