Helius
2020-12-28 7ba7366a8c6ce8019339e433b218386645cb5312
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
<?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>
 
    <select id="selectTdCoinWalletByAddress" resultType="com.xcong.excoin.modules.member.entity.TdCoinWallet">
        select * from td_coin_wallet
        where address=#{address} and symbol=#{symbol}
    </select>
    
    <update id="updateTdCoinWalletAvaliable">
        update td_coin_wallet
        set available_balance=available_balance+#{money}
        where address=#{address}
    </update>
 
    <update id="updateTdCoinWalletTrc20">
        update td_coin_wallet
        set available_balance=available_balance+#{money}
        where mem_id=#{memberId} and symbol ='USDT'
    </update>
 
    <select id="selectMemberWalletCoinByMemberId" resultType="java.util.HashMap">
        select
            member_id,
            MAX(case wallet_code when 'USDT' then available_balance else 0 end) usdt,
            MAX(case wallet_code when 'RFNC' then available_balance else 0 end) rfnc
        from member_wallet_coin
        where member_id=#{memberId}
    </select>
</mapper>