|
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</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, coupon_id, send_time, actual_send_time, error_message, retry_count, max_retries, remark from fs_coupon_schedule
|
|
|
+ select id, user_id, order_id, setmeal_id, month, count, status, create_time, create_by, update_time, update_by, order_time, coupon_id as coupon_ids, send_time, actual_send_time, error_message, retry_count, max_retries, remark from fs_coupon_schedule
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsCouponScheduleList" parameterType="FsCouponSchedule" resultMap="FsCouponScheduleResult">
|
|
@@ -56,7 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectPendingCouponList" resultType="com.fs.store.domain.FsCouponSchedule">
|
|
|
<include refid="selectFsCouponScheduleVo"/>
|
|
|
- where status in (0,-1) and retry_count < 3 and count < month
|
|
|
+ where status IN (0,-1,2) AND retry_count < 3 AND count < month
|
|
|
+ AND now()>=send_time
|
|
|
limit 500
|
|
|
</select>
|
|
|
<select id="selectFsCouponScheduleByOrderId" resultType="com.fs.store.domain.FsCouponSchedule">
|
|
@@ -136,26 +137,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<foreach collection="list" separator=";" item="item">
|
|
|
update fs_coupon_schedule
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="userId != null">user_id = #{item.userId},</if>
|
|
|
- <if test="orderId != null and orderId != ''">order_id = #{item.orderId},</if>
|
|
|
- <if test="setmealId != null">setmeal_id = #{item.setmealId},</if>
|
|
|
- <if test="month != null">month = #{item.month},</if>
|
|
|
- <if test="count != null">count = #{item.count},</if>
|
|
|
- <if test="status != null">status = #{item.status},</if>
|
|
|
- <if test="createTime != null">create_time = #{item.createTime},</if>
|
|
|
- <if test="createBy != null">create_by = #{item.createBy},</if>
|
|
|
- <if test="updateTime != null">update_time = #{item.updateTime},</if>
|
|
|
- <if test="updateBy != null">update_by = #{item.updateBy},</if>
|
|
|
- <if test="orderTime != null">order_time = #{item.orderTime},</if>
|
|
|
- <if test="couponIds != null">coupon_id = #{item.couponIds},</if>
|
|
|
- <if test="sendTime != null">send_time = #{item.sendTime},</if>
|
|
|
- <if test="actualSendTime != null">actual_send_time = #{item.actualSendTime},</if>
|
|
|
- <if test="errorMessage != null">error_message = #{item.errorMessage},</if>
|
|
|
- <if test="retryCount != null">retry_count = #{item.retryCount},</if>
|
|
|
- <if test="maxRetries != null">max_retries = #{item.maxRetries},</if>
|
|
|
- <if test="remark != null">remark = #{item.remark},</if>
|
|
|
+ <if test="item.userId != null">user_id = #{item.userId},</if>
|
|
|
+ <if test="item.orderId != null and item.orderId != ''">order_id = #{item.orderId},</if>
|
|
|
+ <if test="item.setmealId != null">setmeal_id = #{item.setmealId},</if>
|
|
|
+ <if test="item.month != null">month = #{item.month},</if>
|
|
|
+ <if test="item.count != null">count = #{item.count},</if>
|
|
|
+ <if test="item.status != null">status = #{item.status},</if>
|
|
|
+ <if test="item.createTime != null">create_time = #{item.createTime},</if>
|
|
|
+ <if test="item.createBy != null">create_by = #{item.createBy},</if>
|
|
|
+ <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
|
|
+ <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
|
|
+ <if test="item.orderTime != null">order_time = #{item.orderTime},</if>
|
|
|
+ <if test="item.couponIds != null">coupon_id = #{item.couponIds},</if>
|
|
|
+ <if test="item.sendTime != null">send_time = #{item.sendTime},</if>
|
|
|
+ <if test="item.actualSendTime != null">actual_send_time = #{item.actualSendTime},</if>
|
|
|
+ <if test="item.errorMessage != null">error_message = #{item.errorMessage},</if>
|
|
|
+ <if test="item.retryCount != null">retry_count = #{item.retryCount},</if>
|
|
|
+ <if test="item.maxRetries != null">max_retries = #{item.maxRetries},</if>
|
|
|
+ <if test="item.remark != null">remark = #{item.remark},</if>
|
|
|
</trim>
|
|
|
- where id = #{id}
|
|
|
+ where id = #{item.id}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|