|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yijia.integral.mapper.IntegralRuleMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="IntegralRule" id="IntegralRuleResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="stationId" column="station_id" />
|
|
@@ -11,15 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="ruleType" column="rule_type" />
|
|
|
<result property="termDateManage" column="term_date_manage" />
|
|
|
<result property="emptyDate" column="empty_date" />
|
|
|
- <result property="expirationReminder" column="expiration_reminder" />
|
|
|
- <result property="remindDate" column="remind_date" />
|
|
|
<result property="integralActivity" column="integral_activity" />
|
|
|
<result property="datePicker" column="date_picker" />
|
|
|
<result property="integralProportion" column="integral_proportion" />
|
|
|
- <result property="integralDeductionOil" column="integral_deduction_oil" />
|
|
|
<result property="datePickerTime" column="date_picker_time" />
|
|
|
<result property="integralTermSetting" column="integral_term_setting" />
|
|
|
- <result property="integralEmptyTime" column="integral_empty_time" />
|
|
|
<result property="ruleTerms" column="rule_terms" />
|
|
|
<result property="gread" column="gread" />
|
|
|
<result property="oilName" column="oil_name" />
|
|
@@ -30,25 +26,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectIntegralRuleVo">
|
|
|
- select id, station_id, station_name, rule_type, term_date_manage, empty_date, expiration_reminder, remind_date, integral_activity, date_picker, integral_proportion, integral_deduction_oil,date_picker_time,integral_term_setting,integral_empty_time from integral_rule
|
|
|
+ select id, station_id, station_name, rule_type, term_date_manage, empty_date, integral_activity, date_picker, integral_proportion,date_picker_time,integral_term_setting from integral_rule
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectIntegralRuleList" parameterType="IntegralRule" resultMap="IntegralRuleResult">
|
|
|
<include refid="selectIntegralRuleVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
<if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
|
|
|
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType}</if>
|
|
|
<if test="termDateManage != null and termDateManage != ''"> and term_date_manage = #{termDateManage}</if>
|
|
|
<if test="emptyDate != null "> and empty_date = #{emptyDate}</if>
|
|
|
- <if test="expirationReminder != null and expirationReminder != ''"> and expiration_reminder = #{expirationReminder}</if>
|
|
|
- <if test="remindDate != null "> and remind_date = #{remindDate}</if>
|
|
|
<if test="integralActivity != null and integralActivity != ''"> and integral_activity = #{integralActivity}</if>
|
|
|
<if test="datePicker != null and datePicker != ''"> and date_picker = #{datePicker}</if>
|
|
|
<if test="integralProportion != null and integralProportion != ''"> and integral_proportion = #{integralProportion}</if>
|
|
|
- <if test="integralDeductionOil != null and integralDeductionOil != ''"> and integral_deduction_oil = #{integralDeductionOil}</if>
|
|
|
<if test="datePickerTime != null and datePickerTime != ''"> and date_picker_time = #{datePickerTime}</if>
|
|
|
- <if test="integralEmptyTime != null and integralEmptyTime != ''"> and integral_empty_time = #{integralEmptyTime}</if>
|
|
|
<if test="integralTermSetting != null and integralTermSetting != ''"> and integral_term_setting = #{integralTermSetting}</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
and station_id in
|
|
@@ -60,12 +52,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectIntegralRuleById" parameterType="Long" resultMap="IntegralRuleResult">
|
|
|
<include refid="selectIntegralRuleVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertIntegralRule" parameterType="IntegralRule" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into integral_rule
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -74,14 +66,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="ruleType != null">rule_type,</if>
|
|
|
<if test="termDateManage != null">term_date_manage,</if>
|
|
|
<if test="emptyDate != null">empty_date,</if>
|
|
|
- <if test="expirationReminder != null">expiration_reminder,</if>
|
|
|
- <if test="remindDate != null">remind_date,</if>
|
|
|
<if test="integralActivity != null">integral_activity,</if>
|
|
|
<if test="datePicker != null">date_picker,</if>
|
|
|
<if test="integralProportion != null">integral_proportion,</if>
|
|
|
- <if test="integralDeductionOil != null">integral_deduction_oil,</if>
|
|
|
<if test="datePickerTime != null">date_picker_time,</if>
|
|
|
- <if test="integralEmptyTime != null">integral_empty_time,</if>
|
|
|
<if test="integralTermSetting != null">integral_term_setting,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
@@ -110,14 +98,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="ruleType != null">rule_type = #{ruleType},</if>
|
|
|
<if test="termDateManage != null">term_date_manage = #{termDateManage},</if>
|
|
|
<if test="emptyDate != null">empty_date = #{emptyDate},</if>
|
|
|
- <if test="expirationReminder != null">expiration_reminder = #{expirationReminder},</if>
|
|
|
- <if test="remindDate != null">remind_date = #{remindDate},</if>
|
|
|
<if test="integralActivity != null">integral_activity = #{integralActivity},</if>
|
|
|
<if test="datePicker != null">date_picker = #{datePicker},</if>
|
|
|
<if test="integralProportion != null">integral_proportion = #{integralProportion},</if>
|
|
|
- <if test="integralDeductionOil != null">integral_deduction_oil = #{integralDeductionOil},</if>
|
|
|
<if test="datePickerTime != null "> date_picker_time = #{datePickerTime},</if>
|
|
|
- <if test="integralEmptyTime != null "> integral_empty_time = #{integralEmptyTime},</if>
|
|
|
<if test="integralTermSetting != null "> integral_term_setting = #{integralTermSetting},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
@@ -128,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteIntegralRuleByIds" parameterType="String">
|
|
|
- delete from integral_rule where id in
|
|
|
+ delete from integral_rule where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
@@ -141,14 +125,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType}</if>
|
|
|
<if test="termDateManage != null and termDateManage != ''"> and term_date_manage = #{termDateManage}</if>
|
|
|
<if test="emptyDate != null "> and empty_date = #{emptyDate}</if>
|
|
|
- <if test="expirationReminder != null and expirationReminder != ''"> and expiration_reminder = #{expirationReminder}</if>
|
|
|
- <if test="remindDate != null "> and remind_date = #{remindDate}</if>
|
|
|
<if test="integralActivity != null and integralActivity != ''"> and integral_activity = #{integralActivity}</if>
|
|
|
<if test="datePicker != null and datePicker != ''"> and date_picker = #{datePicker}</if>
|
|
|
<if test="integralProportion != null and integralProportion != ''"> and integral_proportion = #{integralProportion}</if>
|
|
|
- <if test="integralDeductionOil != null and integralDeductionOil != ''"> and integral_deduction_oil = #{integralDeductionOil}</if>
|
|
|
<if test="datePickerTime != null and datePickerTime != ''"> and date_picker_time = #{datePickerTime}</if>
|
|
|
- <if test="integralEmptyTime != null and integralEmptyTime != ''"> and integral_empty_time = #{integralEmptyTime}</if>
|
|
|
<if test="integralTermSetting != null and integralTermSetting != ''"> and integral_term_setting = #{integralTermSetting}</if>
|
|
|
<if test="stationIdList != null ">
|
|
|
and station_id in
|
|
@@ -179,4 +159,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
-</mapper>
|
|
|
+</mapper>
|