|
@@ -17,20 +17,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="orderTime" column="order_time" />
|
|
|
- <result property="couponId" column="coupon_id" />
|
|
|
- <result property="couponBatchId" column="coupon_batch_id" />
|
|
|
+ <result property="couponIds" column="coupon_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
|
|
|
+ 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
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsCouponScheduleList" parameterType="FsCouponSchedule" resultMap="FsCouponScheduleResult">
|
|
@@ -43,15 +40,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="couponId != null "> and coupon_id = #{couponId}</if>
|
|
|
- <if test="couponBatchId != null "> and coupon_batch_id = #{couponBatchId}</if>
|
|
|
+ <if test="couponIds != null "> and coupon_id = #{couponIds}</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>
|
|
|
|
|
@@ -63,6 +57,11 @@ 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
|
|
|
+ limit 500
|
|
|
+ </select>
|
|
|
+ <select id="selectFsCouponScheduleByOrderId" resultType="com.fs.store.domain.FsCouponSchedule">
|
|
|
+ <include refid="selectFsCouponScheduleVo"/>
|
|
|
+ where order_id = #{orderId} limit 1
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertFsCouponSchedule" parameterType="FsCouponSchedule" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -79,15 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
<if test="orderTime != null">order_time,</if>
|
|
|
- <if test="couponId != null">coupon_id,</if>
|
|
|
- <if test="couponBatchId != null">coupon_batch_id,</if>
|
|
|
+ <if test="couponIds != null">coupon_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=",">
|
|
@@ -102,15 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="orderTime != null">#{orderTime},</if>
|
|
|
- <if test="couponId != null">#{couponId},</if>
|
|
|
- <if test="couponBatchId != null">#{couponBatchId},</if>
|
|
|
+ <if test="couponIds != null">#{couponIds},</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>
|
|
@@ -129,19 +122,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="couponId != null">coupon_id = #{couponId},</if>
|
|
|
- <if test="couponBatchId != null">coupon_batch_id = #{couponBatchId},</if>
|
|
|
+ <if test="couponIds != null">coupon_id = #{couponIds},</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>
|
|
|
+ <update id="updateBatchFsCouponSchedule">
|
|
|
+ <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>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
|
|
|
<delete id="deleteFsCouponScheduleById" parameterType="Long">
|
|
|
delete from fs_coupon_schedule where id = #{id}
|