xiaoyong931011
2022-09-22 7cf7a80569d3cb907e0260abc3b2dbd36ec6c4c2
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
<?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="cc.mrbird.febs.mall.mapper.MallMemberWalletMapper">
 
    <select id="selectWalletByMemberId" resultType="cc.mrbird.febs.mall.entity.MallMemberWallet">
        select * from mall_member_wallet where member_id=#{memberId}
    </select>
 
    <update id="updateBalanceWithVersion">
        update mall_member_wallet
        set revision = revision + 1,
            balance = #{record.balance}
        where id=#{record.id} and revision=#{record.revision}
    </update>
 
    <update id="updateCommissionWithVersion">
        update mall_member_wallet
        set revision = revision + 1,
            commission = #{record.commission}
        where id=#{record.id} and revision=#{record.revision}
    </update>
 
    <update id="updateBalanceWithId">
        update mall_member_wallet
        set revision = revision + 1,
            balance = #{record.balance}
        where id=#{record.id}
    </update>
 
    <update id="updateAmountWithVersion">
        update mall_member_wallet
        set revision = revision + 1
        <if test="record.balance != null">
            , balance = #{record.balance}
        </if>
        <if test="record.score != null">
            , score = #{record.score}
        </if>
        <if test="record.prizeScore != null">
            , prize_score = #{record.prizeScore}
        </if>
        <if test="record.commission != null">
            , commission = #{record.commission}
        </if>
        where id=#{record.id} and revision=#{record.revision}
    </update>
</mapper>