Helius
2020-12-28 84b8797b64e4ebdc4f8ffcc0d10141c960f8a601
src/main/resources/mapper/modules/MemberWalletCoinMapper.xml
@@ -7,4 +7,29 @@
        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>