From c4957c48499e767280485216ef06f769e3ec7908 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 07 Aug 2023 18:15:38 +0800
Subject: [PATCH] 数据修改

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

diff --git a/src/main/resources/mapper/dapp/DappWalletCoinDao.xml b/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
index 5e7fbeb..c1fc310 100644
--- a/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
+++ b/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
@@ -3,7 +3,7 @@
 <mapper namespace="cc.mrbird.febs.dapp.mapper.DappWalletCoinDao">
 
     <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
-        select * from dapp_wallet_coin where member_id=#{memberId}
+        select * from dapp_wallet_coin where member_id=#{memberId} for update
     </select>
 
     <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
@@ -140,4 +140,17 @@
         where
             member_id = #{memberId}
     </update>
+
+    <update id="reduceTotalAndAvailableByMemberId">
+        update dapp_wallet_coin
+        set
+            total_amount = total_amount - #{balance},
+            available_amount = available_amount - #{balance}
+        where
+            member_id = #{memberId}
+    </update>
+
+    <select id="selectAmountThanZero" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
+        select * from dapp_wallet_coin where available_amount > 0
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1