2019-03-13 20:27:53 +08:00
|
|
|
<?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">
|
2019-03-14 00:20:40 +08:00
|
|
|
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayTransactionNotifyTaskMapper">
|
2019-03-13 20:27:53 +08:00
|
|
|
|
|
|
|
<sql id="FIELDS">
|
|
|
|
id, transaction_id, transaction_extension_id, app_id, order_id,
|
2019-03-14 22:17:56 +08:00
|
|
|
status, next_notify_time, last_execute_time, notify_times, max_notify_times,
|
|
|
|
create_time
|
2019-03-13 20:27:53 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<insert id="insert" parameterType="PayTransactionNotifyTaskDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
|
INSERT INTO transaction_notify_task (
|
|
|
|
transaction_id, transaction_extension_id, app_id, order_id,
|
2019-03-14 22:17:56 +08:00
|
|
|
status, next_notify_time, notify_times, max_notify_times
|
2019-03-13 20:27:53 +08:00
|
|
|
) VALUES (
|
|
|
|
#{transactionId}, #{transactionExtensionId}, #{appId}, #{orderId},
|
2019-03-14 22:17:56 +08:00
|
|
|
#{status}, #{nextNotifyTime}, #{notifyTimes}, #{maxNotifyTimes}
|
2019-03-13 20:27:53 +08:00
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="update" parameterType="PayTransactionNotifyTaskDO">
|
|
|
|
UPDATE transaction_notify_task
|
|
|
|
<set>
|
|
|
|
<if test="status != null">
|
|
|
|
, status = #{status}
|
|
|
|
</if>
|
2019-03-14 22:17:56 +08:00
|
|
|
<if test="nextNotifyTime != null">
|
|
|
|
, next_notify_time = #{nextNotifyTime}
|
|
|
|
</if>
|
|
|
|
<if test="lastExecuteTime != null">
|
|
|
|
, last_execute_time = #{lastExecuteTime}
|
2019-03-13 20:27:53 +08:00
|
|
|
</if>
|
|
|
|
<if test="notifyTimes != null">
|
|
|
|
, notify_times = #{notifyTimes}
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
|
2019-03-14 22:17:56 +08:00
|
|
|
<select id="selectByNotify" resultType="PayTransactionNotifyTaskDO">
|
|
|
|
SELECT
|
|
|
|
<include refid="FIELDS"/>
|
|
|
|
FROM transaction_notify_task
|
|
|
|
WHERE status IN (1, 3, 4, 5)
|
|
|
|
AND next_notify_time <![CDATA[ <= ]]> NOW()
|
|
|
|
AND last_execute_time > next_notify_time
|
|
|
|
</select>
|
2019-03-13 20:27:53 +08:00
|
|
|
|
|
|
|
</mapper>
|