|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yijia.customer.mapper.CustomerGradeSettingMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="CustomerGradeSetting" id="CustomerGradeSettingResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="grade" column="grade" />
|
|
@@ -15,75 +15,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="gasoilGrowthValue" column="gasoil_growth_value" />
|
|
|
<result property="dieseloilConsume" column="dieseloil_consume" />
|
|
|
<result property="dieseloilGrowthValue" column="dieseloil_growth_value" />
|
|
|
+ <result property="memberRecharge" column="member_recharge" />
|
|
|
+ <result property="memberGrowthValue" column="member_growth_value" />
|
|
|
<result property="growthValue" column="growth_value" />
|
|
|
<result property="date" column="date" />
|
|
|
<result property="deductionGrowthValue" column="deduction_growth_value" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCustomerGradeSettingVo">
|
|
|
- select id, grade, discount_way, gasoil_discount_litre, dieseloil_discount_litre, grade_type, gasoil_consume, gasoil_growth_value, dieseloil_consume, dieseloil_growth_value, growth_value, date, deduction_growth_value from customer_grade_setting
|
|
|
+ select id, grade, discount_way, gasoil_discount_litre, dieseloil_discount_litre, grade_type, gasoil_consume, gasoil_growth_value, dieseloil_consume, dieseloil_growth_value, member_recharge, member_growth_value, growth_value, date, deduction_growth_value from customer_grade_setting
|
|
|
</sql>
|
|
|
|
|
|
- <!-- 查询成长规则列表-->
|
|
|
- <select id="getGrouthRuleList" resultType="map">
|
|
|
- SELECT
|
|
|
- id,
|
|
|
- grouth_value_name AS grouthValueName,
|
|
|
- grouth_value_consume AS grouthValueConsume,
|
|
|
- grouth_value AS grouthValue
|
|
|
- FROM
|
|
|
- customer_grouth_rule
|
|
|
- </select>
|
|
|
-
|
|
|
- <!--新增成长规则-->
|
|
|
- <insert id="insertGrouthRule" parameterType="map">
|
|
|
- insert into customer_grouth_rule
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="grouthValueName != null">grouth_value_name,</if>
|
|
|
- <if test="grouthValueConsume != null">grouth_value_consume,</if>
|
|
|
- <if test="grouthValue != null">grouth_value</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="grouthValueName != null">#{grouthValueName},</if>
|
|
|
- <if test="grouthValueConsume != null">#{grouthValueConsume},</if>
|
|
|
- <if test="grouthValue != null">#{grouthValue}</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <!-- 更新成长规则-->
|
|
|
- <update id="updateGrouthRule" parameterType="map">
|
|
|
- UPDATE customer_grouth_rule
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="grouthValueName != null">grouth_value_name = #{grouthValueName},</if>
|
|
|
- <if test="grouthValueConsume != null">grouth_value_consume = #{grouthValueConsume},</if>
|
|
|
- <if test="grouthValue != null">grouth_value = #{grouthValue}</if>
|
|
|
- </trim>
|
|
|
- WHERE id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <!--删除一条成长规则-->
|
|
|
- <delete id="deleteGrouthRuleById" parameterType="String">
|
|
|
- DELETE
|
|
|
- FROM
|
|
|
- customer_grouth_rule
|
|
|
- WHERE id = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <!--批量删除成长规则-->
|
|
|
- <delete id="deleteGrouthRuleByIds" parameterType="Long">
|
|
|
- DELETE
|
|
|
- FROM
|
|
|
- customer_grouth_rule
|
|
|
- WHERE id IN
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
-
|
|
|
<select id="selectCustomerGradeSettingList" parameterType="CustomerGradeSetting" resultMap="CustomerGradeSettingResult">
|
|
|
<include refid="selectCustomerGradeSettingVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="grade != null and grade != ''"> and grade = #{grade}</if>
|
|
|
<if test="discountWay != null and discountWay != ''"> and discount_way = #{discountWay}</if>
|
|
|
<if test="gasoilDiscountLitre != null and gasoilDiscountLitre != ''"> and gasoil_discount_litre = #{gasoilDiscountLitre}</if>
|
|
@@ -93,21 +38,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="gasoilGrowthValue != null and gasoilGrowthValue != ''"> and gasoil_growth_value = #{gasoilGrowthValue}</if>
|
|
|
<if test="dieseloilConsume != null and dieseloilConsume != ''"> and dieseloil_consume = #{dieseloilConsume}</if>
|
|
|
<if test="dieseloilGrowthValue != null and dieseloilGrowthValue != ''"> and dieseloil_growth_value = #{dieseloilGrowthValue}</if>
|
|
|
+ <if test="memberRecharge != null and memberRecharge != ''"> and member_recharge = #{memberRecharge}</if>
|
|
|
+ <if test="memberGrowthValue != null and memberGrowthValue != ''"> and member_growth_value = #{memberGrowthValue}</if>
|
|
|
<if test="growthValue != null and growthValue != ''"> and growth_value = #{growthValue}</if>
|
|
|
<if test="date != null "> and date = #{date}</if>
|
|
|
<if test="deductionGrowthValue != null and deductionGrowthValue != ''"> and deduction_growth_value = #{deductionGrowthValue}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectCustomerGradeSettingById" parameterType="Long" resultMap="CustomerGradeSettingResult">
|
|
|
<include refid="selectCustomerGradeSettingVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <insert id="insertCustomerGradeSetting" parameterType="CustomerGradeSetting">
|
|
|
+
|
|
|
+ <insert id="insertCustomerGradeSetting" parameterType="CustomerGradeSetting" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into customer_grade_setting
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">id,</if>
|
|
|
<if test="grade != null">grade,</if>
|
|
|
<if test="discountWay != null">discount_way,</if>
|
|
|
<if test="gasoilDiscountLitre != null">gasoil_discount_litre,</if>
|
|
@@ -117,12 +63,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="gasoilGrowthValue != null">gasoil_growth_value,</if>
|
|
|
<if test="dieseloilConsume != null">dieseloil_consume,</if>
|
|
|
<if test="dieseloilGrowthValue != null">dieseloil_growth_value,</if>
|
|
|
+ <if test="memberRecharge != null">member_recharge,</if>
|
|
|
+ <if test="memberGrowthValue != null">member_growth_value,</if>
|
|
|
<if test="growthValue != null">growth_value,</if>
|
|
|
<if test="date != null">date,</if>
|
|
|
<if test="deductionGrowthValue != null">deduction_growth_value,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">#{id},</if>
|
|
|
<if test="grade != null">#{grade},</if>
|
|
|
<if test="discountWay != null">#{discountWay},</if>
|
|
|
<if test="gasoilDiscountLitre != null">#{gasoilDiscountLitre},</if>
|
|
@@ -132,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="gasoilGrowthValue != null">#{gasoilGrowthValue},</if>
|
|
|
<if test="dieseloilConsume != null">#{dieseloilConsume},</if>
|
|
|
<if test="dieseloilGrowthValue != null">#{dieseloilGrowthValue},</if>
|
|
|
+ <if test="memberRecharge != null">#{memberRecharge},</if>
|
|
|
+ <if test="memberGrowthValue != null">#{memberGrowthValue},</if>
|
|
|
<if test="growthValue != null">#{growthValue},</if>
|
|
|
<if test="date != null">#{date},</if>
|
|
|
<if test="deductionGrowthValue != null">#{deductionGrowthValue},</if>
|
|
@@ -150,6 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="gasoilGrowthValue != null">gasoil_growth_value = #{gasoilGrowthValue},</if>
|
|
|
<if test="dieseloilConsume != null">dieseloil_consume = #{dieseloilConsume},</if>
|
|
|
<if test="dieseloilGrowthValue != null">dieseloil_growth_value = #{dieseloilGrowthValue},</if>
|
|
|
+ <if test="memberRecharge != null">member_recharge = #{memberRecharge},</if>
|
|
|
+ <if test="memberGrowthValue != null">member_growth_value = #{memberGrowthValue},</if>
|
|
|
<if test="growthValue != null">growth_value = #{growthValue},</if>
|
|
|
<if test="date != null">date = #{date},</if>
|
|
|
<if test="deductionGrowthValue != null">deduction_growth_value = #{deductionGrowthValue},</if>
|
|
@@ -162,10 +113,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCustomerGradeSettingByIds" parameterType="String">
|
|
|
- delete from customer_grade_setting where id in
|
|
|
+ delete from customer_grade_setting where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|