From b8bf19375db90bf5bd409cacfe6cb066c5f2b34a Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 25 Oct 2022 00:19:56 +0800
Subject: [PATCH] 20221021

---
 src/main/resources/mapper/dapp/DappWalletCoinDao.xml |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/dapp/DappWalletCoinDao.xml b/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
index 885c20f..2b0a088 100644
--- a/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
+++ b/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
@@ -68,4 +68,58 @@
               id = #{id}
            and total_amount - #{balance} <![CDATA[ >= ]]> 0
     </update>
+
+
+    <select id="selectWalletCoinBymIdAndCode" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
+        select * from member_wallet_coin where member_id = #{memberId} and wallet_code = #{walletCode}
+    </select>
+
+    <update id="updateFrozenBalance" parameterType="map">
+        UPDATE member_wallet_coin
+        SET available_balance = available_balance - #{amount},
+            frozen_balance = frozen_balance + #{amount}
+        WHERE
+            id = #{id}
+          AND member_id = #{memberId}
+    </update>
+
+    <update id="subFrozenBalance" parameterType="map">
+        UPDATE member_wallet_coin
+        SET available_balance = available_balance + #{amount},
+            frozen_balance = frozen_balance - #{amount}
+        WHERE
+            id = #{id}
+          AND member_id = #{memberId}
+    </update>
+
+
+    <update id="updateBlockBalance">
+        update member_wallet_coin
+        set
+            available_balance = IFNULL(available_balance, 0) + #{availableBalance},
+            total_balance = IFNULL(total_balance, 0) + #{availableBalance},
+            early_balance = IFNULL(early_balance, 0) + #{earlyBalance},
+            block_number  = IFNULL(block_number, 0) + #{blockNumber}
+        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>
+
+    <select id="selectTotalAmount" resultType="cc.mrbird.febs.dapp.entity.DappMemberEntity">
+        select
+               b.id,
+               b.invite_id,
+               b.referer_id,
+               b.identity,
+               b.referer_ids
+        from
+            dapp_wallet_coin a
+        inner join dapp_member b on a.member_id = b.id
+        where a.total_amount <![CDATA[ >= ]]> 51
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1