|  | @@ -0,0 +1,157 @@
 | 
	
		
			
				|  |  | +<?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.fs.store.mapper.FsCouponScheduleMapper">
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <resultMap type="FsCouponSchedule" id="FsCouponScheduleResult">
 | 
	
		
			
				|  |  | +        <result property="id"    column="id"    />
 | 
	
		
			
				|  |  | +        <result property="userId"    column="user_id"    />
 | 
	
		
			
				|  |  | +        <result property="orderId"    column="order_id"    />
 | 
	
		
			
				|  |  | +        <result property="setmealId"    column="setmeal_id"    />
 | 
	
		
			
				|  |  | +        <result property="month"    column="month"    />
 | 
	
		
			
				|  |  | +        <result property="count"    column="count"    />
 | 
	
		
			
				|  |  | +        <result property="status"    column="status"    />
 | 
	
		
			
				|  |  | +        <result property="createTime"    column="create_time"    />
 | 
	
		
			
				|  |  | +        <result property="createBy"    column="create_by"    />
 | 
	
		
			
				|  |  | +        <result property="updateTime"    column="update_time"    />
 | 
	
		
			
				|  |  | +        <result property="updateBy"    column="update_by"    />
 | 
	
		
			
				|  |  | +        <result property="orderTime"    column="order_time"    />
 | 
	
		
			
				|  |  | +        <result property="executeTime"    column="execute_time"    />
 | 
	
		
			
				|  |  | +        <result property="couponId"    column="coupon_id"    />
 | 
	
		
			
				|  |  | +        <result property="couponBatchId"    column="coupon_batch_id"    />
 | 
	
		
			
				|  |  | +        <result property="sendTime"    column="send_time"    />
 | 
	
		
			
				|  |  | +        <result property="actualSendTime"    column="actual_send_time"    />
 | 
	
		
			
				|  |  | +        <result property="errorMessage"    column="error_message"    />
 | 
	
		
			
				|  |  | +        <result property="retryCount"    column="retry_count"    />
 | 
	
		
			
				|  |  | +        <result property="maxRetries"    column="max_retries"    />
 | 
	
		
			
				|  |  | +        <result property="nextRetryTime"    column="next_retry_time"    />
 | 
	
		
			
				|  |  | +        <result property="sourceType"    column="source_type"    />
 | 
	
		
			
				|  |  | +        <result property="remark"    column="remark"    />
 | 
	
		
			
				|  |  | +    </resultMap>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <sql id="selectFsCouponScheduleVo">
 | 
	
		
			
				|  |  | +        select id, user_id, order_id, setmeal_id, month, count, status, create_time, create_by, update_time, update_by, order_time, execute_time, coupon_id, coupon_batch_id, send_time, actual_send_time, error_message, retry_count, max_retries, next_retry_time, source_type, remark from fs_coupon_schedule
 | 
	
		
			
				|  |  | +    </sql>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="selectFsCouponScheduleList" parameterType="FsCouponSchedule" resultMap="FsCouponScheduleResult">
 | 
	
		
			
				|  |  | +        <include refid="selectFsCouponScheduleVo"/>
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            <if test="userId != null "> and user_id = #{userId}</if>
 | 
	
		
			
				|  |  | +            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
 | 
	
		
			
				|  |  | +            <if test="setmealId != null "> and setmeal_id = #{setmealId}</if>
 | 
	
		
			
				|  |  | +            <if test="month != null "> and month = #{month}</if>
 | 
	
		
			
				|  |  | +            <if test="count != null "> and count = #{count}</if>
 | 
	
		
			
				|  |  | +            <if test="status != null "> and status = #{status}</if>
 | 
	
		
			
				|  |  | +            <if test="orderTime != null "> and order_time = #{orderTime}</if>
 | 
	
		
			
				|  |  | +            <if test="executeTime != null "> and execute_time = #{executeTime}</if>
 | 
	
		
			
				|  |  | +            <if test="couponId != null "> and coupon_id = #{couponId}</if>
 | 
	
		
			
				|  |  | +            <if test="couponBatchId != null "> and coupon_batch_id = #{couponBatchId}</if>
 | 
	
		
			
				|  |  | +            <if test="sendTime != null "> and send_time = #{sendTime}</if>
 | 
	
		
			
				|  |  | +            <if test="actualSendTime != null "> and actual_send_time = #{actualSendTime}</if>
 | 
	
		
			
				|  |  | +            <if test="errorMessage != null  and errorMessage != ''"> and error_message = #{errorMessage}</if>
 | 
	
		
			
				|  |  | +            <if test="retryCount != null "> and retry_count = #{retryCount}</if>
 | 
	
		
			
				|  |  | +            <if test="maxRetries != null "> and max_retries = #{maxRetries}</if>
 | 
	
		
			
				|  |  | +            <if test="nextRetryTime != null "> and next_retry_time = #{nextRetryTime}</if>
 | 
	
		
			
				|  |  | +            <if test="sourceType != null  and sourceType != ''"> and source_type = #{sourceType}</if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="selectFsCouponScheduleById" parameterType="Long" resultMap="FsCouponScheduleResult">
 | 
	
		
			
				|  |  | +        <include refid="selectFsCouponScheduleVo"/>
 | 
	
		
			
				|  |  | +        where id = #{id}
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <insert id="insertFsCouponSchedule" parameterType="FsCouponSchedule" useGeneratedKeys="true" keyProperty="id">
 | 
	
		
			
				|  |  | +        insert into fs_coupon_schedule
 | 
	
		
			
				|  |  | +        <trim prefix="(" suffix=")" suffixOverrides=",">
 | 
	
		
			
				|  |  | +            <if test="userId != null">user_id,</if>
 | 
	
		
			
				|  |  | +            <if test="orderId != null and orderId != ''">order_id,</if>
 | 
	
		
			
				|  |  | +            <if test="setmealId != null">setmeal_id,</if>
 | 
	
		
			
				|  |  | +            <if test="month != null">month,</if>
 | 
	
		
			
				|  |  | +            <if test="count != null">count,</if>
 | 
	
		
			
				|  |  | +            <if test="status != null">status,</if>
 | 
	
		
			
				|  |  | +            <if test="createTime != null">create_time,</if>
 | 
	
		
			
				|  |  | +            <if test="createBy != null">create_by,</if>
 | 
	
		
			
				|  |  | +            <if test="updateTime != null">update_time,</if>
 | 
	
		
			
				|  |  | +            <if test="updateBy != null">update_by,</if>
 | 
	
		
			
				|  |  | +            <if test="orderTime != null">order_time,</if>
 | 
	
		
			
				|  |  | +            <if test="executeTime != null">execute_time,</if>
 | 
	
		
			
				|  |  | +            <if test="couponId != null">coupon_id,</if>
 | 
	
		
			
				|  |  | +            <if test="couponBatchId != null">coupon_batch_id,</if>
 | 
	
		
			
				|  |  | +            <if test="sendTime != null">send_time,</if>
 | 
	
		
			
				|  |  | +            <if test="actualSendTime != null">actual_send_time,</if>
 | 
	
		
			
				|  |  | +            <if test="errorMessage != null">error_message,</if>
 | 
	
		
			
				|  |  | +            <if test="retryCount != null">retry_count,</if>
 | 
	
		
			
				|  |  | +            <if test="maxRetries != null">max_retries,</if>
 | 
	
		
			
				|  |  | +            <if test="nextRetryTime != null">next_retry_time,</if>
 | 
	
		
			
				|  |  | +            <if test="sourceType != null">source_type,</if>
 | 
	
		
			
				|  |  | +            <if test="remark != null">remark,</if>
 | 
	
		
			
				|  |  | +         </trim>
 | 
	
		
			
				|  |  | +        <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
	
		
			
				|  |  | +            <if test="userId != null">#{userId},</if>
 | 
	
		
			
				|  |  | +            <if test="orderId != null and orderId != ''">#{orderId},</if>
 | 
	
		
			
				|  |  | +            <if test="setmealId != null">#{setmealId},</if>
 | 
	
		
			
				|  |  | +            <if test="month != null">#{month},</if>
 | 
	
		
			
				|  |  | +            <if test="count != null">#{count},</if>
 | 
	
		
			
				|  |  | +            <if test="status != null">#{status},</if>
 | 
	
		
			
				|  |  | +            <if test="createTime != null">#{createTime},</if>
 | 
	
		
			
				|  |  | +            <if test="createBy != null">#{createBy},</if>
 | 
	
		
			
				|  |  | +            <if test="updateTime != null">#{updateTime},</if>
 | 
	
		
			
				|  |  | +            <if test="updateBy != null">#{updateBy},</if>
 | 
	
		
			
				|  |  | +            <if test="orderTime != null">#{orderTime},</if>
 | 
	
		
			
				|  |  | +            <if test="executeTime != null">#{executeTime},</if>
 | 
	
		
			
				|  |  | +            <if test="couponId != null">#{couponId},</if>
 | 
	
		
			
				|  |  | +            <if test="couponBatchId != null">#{couponBatchId},</if>
 | 
	
		
			
				|  |  | +            <if test="sendTime != null">#{sendTime},</if>
 | 
	
		
			
				|  |  | +            <if test="actualSendTime != null">#{actualSendTime},</if>
 | 
	
		
			
				|  |  | +            <if test="errorMessage != null">#{errorMessage},</if>
 | 
	
		
			
				|  |  | +            <if test="retryCount != null">#{retryCount},</if>
 | 
	
		
			
				|  |  | +            <if test="maxRetries != null">#{maxRetries},</if>
 | 
	
		
			
				|  |  | +            <if test="nextRetryTime != null">#{nextRetryTime},</if>
 | 
	
		
			
				|  |  | +            <if test="sourceType != null">#{sourceType},</if>
 | 
	
		
			
				|  |  | +            <if test="remark != null">#{remark},</if>
 | 
	
		
			
				|  |  | +         </trim>
 | 
	
		
			
				|  |  | +    </insert>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <update id="updateFsCouponSchedule" parameterType="FsCouponSchedule">
 | 
	
		
			
				|  |  | +        update fs_coupon_schedule
 | 
	
		
			
				|  |  | +        <trim prefix="SET" suffixOverrides=",">
 | 
	
		
			
				|  |  | +            <if test="userId != null">user_id = #{userId},</if>
 | 
	
		
			
				|  |  | +            <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
 | 
	
		
			
				|  |  | +            <if test="setmealId != null">setmeal_id = #{setmealId},</if>
 | 
	
		
			
				|  |  | +            <if test="month != null">month = #{month},</if>
 | 
	
		
			
				|  |  | +            <if test="count != null">count = #{count},</if>
 | 
	
		
			
				|  |  | +            <if test="status != null">status = #{status},</if>
 | 
	
		
			
				|  |  | +            <if test="createTime != null">create_time = #{createTime},</if>
 | 
	
		
			
				|  |  | +            <if test="createBy != null">create_by = #{createBy},</if>
 | 
	
		
			
				|  |  | +            <if test="updateTime != null">update_time = #{updateTime},</if>
 | 
	
		
			
				|  |  | +            <if test="updateBy != null">update_by = #{updateBy},</if>
 | 
	
		
			
				|  |  | +            <if test="orderTime != null">order_time = #{orderTime},</if>
 | 
	
		
			
				|  |  | +            <if test="executeTime != null">execute_time = #{executeTime},</if>
 | 
	
		
			
				|  |  | +            <if test="couponId != null">coupon_id = #{couponId},</if>
 | 
	
		
			
				|  |  | +            <if test="couponBatchId != null">coupon_batch_id = #{couponBatchId},</if>
 | 
	
		
			
				|  |  | +            <if test="sendTime != null">send_time = #{sendTime},</if>
 | 
	
		
			
				|  |  | +            <if test="actualSendTime != null">actual_send_time = #{actualSendTime},</if>
 | 
	
		
			
				|  |  | +            <if test="errorMessage != null">error_message = #{errorMessage},</if>
 | 
	
		
			
				|  |  | +            <if test="retryCount != null">retry_count = #{retryCount},</if>
 | 
	
		
			
				|  |  | +            <if test="maxRetries != null">max_retries = #{maxRetries},</if>
 | 
	
		
			
				|  |  | +            <if test="nextRetryTime != null">next_retry_time = #{nextRetryTime},</if>
 | 
	
		
			
				|  |  | +            <if test="sourceType != null">source_type = #{sourceType},</if>
 | 
	
		
			
				|  |  | +            <if test="remark != null">remark = #{remark},</if>
 | 
	
		
			
				|  |  | +        </trim>
 | 
	
		
			
				|  |  | +        where id = #{id}
 | 
	
		
			
				|  |  | +    </update>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <delete id="deleteFsCouponScheduleById" parameterType="Long">
 | 
	
		
			
				|  |  | +        delete from fs_coupon_schedule where id = #{id}
 | 
	
		
			
				|  |  | +    </delete>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <delete id="deleteFsCouponScheduleByIds" parameterType="String">
 | 
	
		
			
				|  |  | +        delete from fs_coupon_schedule where id in
 | 
	
		
			
				|  |  | +        <foreach item="id" collection="array" open="(" separator="," close=")">
 | 
	
		
			
				|  |  | +            #{id}
 | 
	
		
			
				|  |  | +        </foreach>
 | 
	
		
			
				|  |  | +    </delete>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +</mapper>
 |