| 
					
				 | 
			
			
				@@ -18,10 +18,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <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"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="saleAmt"    column="sale_amt"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="integral"    column="integral"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="oilType"    column="oil_type"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </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 from integral_rule 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectIntegralRuleList" parameterType="IntegralRule" resultMap="IntegralRuleResult"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -39,6 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -70,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <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=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="stationId != null">#{stationId},</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -84,6 +96,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="integralProportion != null">#{integralProportion},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="integralDeductionOil != null">#{integralDeductionOil},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="datePickerTime != null">#{datePickerTime},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="integralEmptyTime != null">#{integralEmptyTime},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="integralTermSetting != null">#{integralTermSetting},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          </trim> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </insert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -101,7 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <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  and datePickerTime != ''">  date_picker_time = #{datePickerTime},</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} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </update> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -116,5 +132,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             #{id} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </delete> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectIntegralRule" parameterType="IntegralRule" resultMap="IntegralRuleResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <include refid="selectIntegralRuleVo"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        order by  id desc limit 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="listRuleInfo" parameterType="IntegralRule" resultMap="IntegralRuleResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT a.station_id,a.station_name,a.term_date_manage,a.integral_activity,empty_date,date_picker,integral_proportion,b.rule_type,rule_terms,gread,oil_name,sale_amt,integral,oil_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        from integral_rule a join integral_rule_detail b on a.id =b.parent_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationId != null "> and a.station_id = #{stationId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationName != null  and stationName != ''"> and a.station_name like concat('%', #{stationName}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="stationIdList != null "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.station_id in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <foreach item="item" index="index" collection="stationIdList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         open="(" separator="," close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    #{item} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |