123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- 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" />
- <result property="discountWay" column="discount_way" />
- <result property="gasoilDiscountLitre" column="gasoil_discount_litre" />
- <result property="dieseloilDiscountLitre" column="dieseloil_discount_litre" />
- <result property="gradeType" column="grade_type" />
- <result property="gasoilConsume" column="gasoil_consume" />
- <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" />
- <result property="memberCondit" column="member_condit" />
- <result property="stationId" column="station_id" />
- <result property="stationName" column="station_name" />
- <result property="oilName" column="oil_name" />
- <result property="memberConditStart" column="member_condit_start" />
- <result property="memberConditEnd" column="member_condit_end" />
- </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, member_recharge, member_growth_value, growth_value, date, deduction_growth_value, member_condit, station_id, station_name, oil_name, member_condit_start, member_condit_end from customer_grade_setting
- </sql>
- <select id="selectCustomerGradeSettingList" parameterType="CustomerGradeSetting" resultMap="CustomerGradeSettingResult">
- <include refid="selectCustomerGradeSettingVo"/>
- <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>
- <if test="dieseloilDiscountLitre != null and dieseloilDiscountLitre != ''"> and dieseloil_discount_litre = #{dieseloilDiscountLitre}</if>
- <if test="gradeType != null and gradeType != ''"> and grade_type = #{gradeType}</if>
- <if test="gasoilConsume != null and gasoilConsume != ''"> and gasoil_consume = #{gasoilConsume}</if>
- <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>
- <if test="memberCondit != null and memberCondit != ''"> and member_condit = #{memberCondit}</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="oilName != null and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
- <if test="memberConditStart != null "> and member_condit_start = #{memberConditStart}</if>
- <if test="memberConditEnd != null "> and member_condit_end = #{memberConditEnd}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- order by id desc
- </select>
- <select id="selectCustomerGradeSettingById" parameterType="Long" resultMap="CustomerGradeSettingResult">
- <include refid="selectCustomerGradeSettingVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertCustomerGradeSetting" parameterType="CustomerGradeSetting" useGeneratedKeys="true" keyProperty="id">
- insert into customer_grade_setting
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="grade != null">grade,</if>
- <if test="discountWay != null">discount_way,</if>
- <if test="gasoilDiscountLitre != null">gasoil_discount_litre,</if>
- <if test="dieseloilDiscountLitre != null">dieseloil_discount_litre,</if>
- <if test="gradeType != null">grade_type,</if>
- <if test="gasoilConsume != null">gasoil_consume,</if>
- <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>
- <if test="memberCondit != null">member_condit,</if>
- <if test="stationId != null">station_id,</if>
- <if test="stationName != null">station_name,</if>
- <if test="oilName != null">oil_name,</if>
- <if test="memberConditStart != null">member_condit_start,</if>
- <if test="memberConditEnd != null">member_condit_end,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="grade != null">#{grade},</if>
- <if test="discountWay != null">#{discountWay},</if>
- <if test="gasoilDiscountLitre != null">#{gasoilDiscountLitre},</if>
- <if test="dieseloilDiscountLitre != null">#{dieseloilDiscountLitre},</if>
- <if test="gradeType != null">#{gradeType},</if>
- <if test="gasoilConsume != null">#{gasoilConsume},</if>
- <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>
- <if test="memberCondit != null">#{memberCondit},</if>
- <if test="stationId != null">#{stationId},</if>
- <if test="stationName != null">#{stationName},</if>
- <if test="oilName != null">#{oilName},</if>
- <if test="memberConditStart != null">#{memberConditStart},</if>
- <if test="memberConditEnd != null">#{memberConditEnd},</if>
- </trim>
- </insert>
- <update id="updateCustomerGradeSetting" parameterType="CustomerGradeSetting">
- update customer_grade_setting
- <trim prefix="SET" suffixOverrides=",">
- <if test="grade != null">grade = #{grade},</if>
- <if test="discountWay != null">discount_way = #{discountWay},</if>
- <if test="gasoilDiscountLitre != null">gasoil_discount_litre = #{gasoilDiscountLitre},</if>
- <if test="dieseloilDiscountLitre != null">dieseloil_discount_litre = #{dieseloilDiscountLitre},</if>
- <if test="gradeType != null">grade_type = #{gradeType},</if>
- <if test="gasoilConsume != null">gasoil_consume = #{gasoilConsume},</if>
- <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>
- <if test="memberCondit != null">member_condit = #{memberCondit},</if>
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="stationName != null">station_name = #{stationName},</if>
- <if test="oilName != null">oil_name = #{oilName},</if>
- <if test="memberConditStart != null">member_condit_start = #{memberConditStart},</if>
- <if test="memberConditEnd != null">member_condit_end = #{memberConditEnd},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCustomerGradeSettingById" parameterType="Long">
- delete from customer_grade_setting where id = #{id}
- </delete>
- <delete id="deleteCustomerGradeSettingByIds" parameterType="String">
- delete from customer_grade_setting where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-
- </mapper>
|