xiaoyong931011
2022-03-10 bbb534452576d50da0e116ae0a25f5c172aae095
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
<?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.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper">
 
 
    <select id="findWalletCoinByMemberIdAndWalletCode" resultType="com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity">
        select * from member_wallet_coin where member_id = #{memberId} and wallet_code = #{walletCode}
    </select>
 
 
    <update id="updateBlockBalance">
        update member_wallet_coin
        set
            available_balance = IFNULL(available_balance, 0) + #{availableBalance},
            total_balance = IFNULL(total_balance, 0) + #{availableBalance}
        where id=#{id}
    </update>
 
    <update id="reduceFrozenBalance">
        update member_wallet_coin
        set frozen_balance = frozen_balance - #{amount},
            total_balance = total_balance - #{amount}
        where id=#{id}
    </update>
 
</mapper>