<?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.ruoyi.payment.infrastructure.persistence.mapper.NotifyLogMapper">
|
|
<resultMap id="NotifyLogResult" type="com.ruoyi.payment.domain.model.NotifyLog">
|
<id property="id" column="id"/>
|
<result property="channel" column="channel"/>
|
<result property="notifyIdOrSerial" column="notify_id_or_serial"/>
|
<result property="orderId" column="order_id"/>
|
<result property="transactionId" column="transaction_id"/>
|
<result property="payload" column="payload"/>
|
<result property="verified" column="verified"/>
|
<result property="processed" column="processed"/>
|
<result property="result" column="result"/>
|
<result property="createdAt" column="created_at"/>
|
</resultMap>
|
|
<insert id="insert" parameterType="com.ruoyi.payment.domain.model.NotifyLog">
|
INSERT INTO pay_notify_log (
|
id, channel, notify_id_or_serial, order_id, transaction_id,
|
payload, verified, processed, result, created_at
|
) VALUES (
|
#{id}, #{channel}, #{notifyIdOrSerial}, #{orderId}, #{transactionId},
|
#{payload}, #{verified}, #{processed}, #{result}, #{createdAt}
|
)
|
</insert>
|
|
<update id="update" parameterType="com.ruoyi.payment.domain.model.NotifyLog">
|
UPDATE pay_notify_log
|
<set>
|
<if test="channel != null">channel = #{channel},</if>
|
<if test="notifyIdOrSerial != null">notify_id_or_serial = #{notifyIdOrSerial},</if>
|
<if test="orderId != null">order_id = #{orderId},</if>
|
<if test="transactionId != null">transaction_id = #{transactionId},</if>
|
<if test="payload != null">payload = #{payload},</if>
|
<if test="verified != null">verified = #{verified},</if>
|
<if test="processed != null">processed = #{processed},</if>
|
<if test="result != null">result = #{result},</if>
|
</set>
|
WHERE id = #{id}
|
</update>
|
|
<select id="selectById" resultMap="NotifyLogResult">
|
SELECT * FROM pay_notify_log
|
WHERE id = #{id}
|
</select>
|
|
<select id="selectProcessedCount" resultType="int">
|
SELECT COUNT(*) FROM pay_notify_log
|
WHERE channel = #{channel}
|
AND notify_id_or_serial = #{notifyIdOrSerial}
|
AND processed = 1
|
</select>
|
|
</mapper>
|