wlzboy
5 天以前 c098f1e3a3e052aa3d65584aae6dc003a70d75ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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>