|
@@ -5,30 +5,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.yijia.customer.mapper.CustomerGradeSettingMapper">
|
|
|
|
|
|
<resultMap type="CustomerGradeSetting" id="CustomerGradeSettingResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="grade" column="grade" />
|
|
|
- <result property="oilName" column="oil_name" />
|
|
|
- <result property="memberConditStart" column="member_condit_start" />
|
|
|
- <result property="memberConditEnd" column="member_condit_end" />
|
|
|
- <result property="discountAmt" column="discount_amt" />
|
|
|
- <result property="stationId" column="station_id" />
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="grade" column="grade" />
|
|
|
+ <result property="oilName" column="oil_name" />
|
|
|
+ <result property="memberConditStart" column="member_condit_start" />
|
|
|
+ <result property="memberConditEnd" column="member_condit_end" />
|
|
|
+ <result property="discountAmt" column="discount_amt"/>
|
|
|
+ <result property="stationId" column="station_id"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <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="selectCustomerGradeSettingVo">
|
|
|
- select id, grade, discount_amt, station_id, oil_name, member_condit_start, member_condit_end from customer_grade_setting
|
|
|
+ select s.id, s.grade, s.discount_amt, s.station_id, s.oil_name, s.member_condit_start, s.member_condit_end,s.create_by,
|
|
|
+ s.create_time,s.update_by,s.update_time,s.del_flag,d.dept_name as station_name
|
|
|
+ from customer_grade_setting s join sys_dept d on d.dept_id =s.station_id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCustomerGradeSettingList" parameterType="CustomerGradeSetting" resultMap="CustomerGradeSettingResult">
|
|
|
- <include refid="selectCustomerGradeSettingVo"/>
|
|
|
+ select s.id, s.grade, s.discount_amt, s.station_id, s.oil_name, s.member_condit_start, s.member_condit_end,s.create_by,
|
|
|
+ s.create_time,s.update_by,s.update_time,s.del_flag,d.dept_name as station_name
|
|
|
+ from customer_grade_setting s join sys_dept d on d.dept_id =s.station_id
|
|
|
<where>
|
|
|
- <if test="grade != null and grade != ''"> and grade = #{grade}</if>
|
|
|
- <if test="discountAmt != null and discountAmt != ''"> and discount_amt = #{discountAmt}</if>
|
|
|
- <if test="stationId != null "> and station_id = #{stationId}</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="grade != null and grade != ''"> and s.grade = #{grade}</if>
|
|
|
+ <if test="discountAmt != null and discountAmt != ''"> and s.discount_amt = #{discountAmt}</if>
|
|
|
+ <if test="stationId != null "> and s.station_id = #{stationId}</if>
|
|
|
+ <if test="oilName != null and oilName != ''"> and s.oil_name like concat('%', #{oilName}, '%')</if>
|
|
|
+ <if test="memberConditStart != null "> and s.member_condit_start = #{memberConditStart}</if>
|
|
|
+ <if test="memberConditEnd != null "> and s.member_condit_end = #{memberConditEnd}</if>
|
|
|
+ <if test="delFlag != null "> and s.del_flag = #{delFlag}</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
- and station_id in
|
|
|
+ and s.station_id in
|
|
|
<foreach item="item" index="index" collection="stationIdList"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -39,7 +49,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCustomerGradeSettingById" parameterType="Long" resultMap="CustomerGradeSettingResult">
|
|
|
- <include refid="selectCustomerGradeSettingVo"/>
|
|
|
+ select s.id, s.grade, s.discount_amt, s.station_id, s.oil_name, s.member_condit_start, s.member_condit_end,s.create_by,
|
|
|
+ s.create_time,s.update_by,s.update_time,s.delFlag,d.dept_name as station_name
|
|
|
+ from customer_grade_setting s join sys_dept d on d.dept_id =s.station_id
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
@@ -52,14 +64,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="oilName != null">oil_name,</if>
|
|
|
<if test="memberConditStart != null">member_condit_start,</if>
|
|
|
<if test="memberConditEnd != null">member_condit_end,</if>
|
|
|
+ <if test="delFlag != null">delFlag,</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="discountAmt != null">discount_amt,</if>
|
|
|
+ <if test="discountAmt != null">#{discountAmt},</if>
|
|
|
<if test="stationId != null">#{stationId},</if>
|
|
|
<if test="oilName != null">#{oilName},</if>
|
|
|
<if test="memberConditStart != null">#{memberConditStart},</if>
|
|
|
<if test="memberConditEnd != null">#{memberConditEnd},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</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>
|
|
|
|
|
@@ -72,6 +94,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="memberConditEnd != null">member_condit_end = #{memberConditEnd},</if>
|
|
|
<if test="discountAmt != null">discount_amt = #{discountAmt},</if>
|
|
|
<if test="stationId != null">station_id = #{stationId},</if>
|
|
|
+ <if test="delFlag != null">del_flag=#{delFlag},</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>
|