From 69d96e4ad5b849cb4ebe2d18805f751d9c7035ca Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 18 Aug 2023 17:36:40 +0800
Subject: [PATCH] 后台修改

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

diff --git a/src/main/resources/mapper/dapp/DappWalletCoinDao.xml b/src/main/resources/mapper/dapp/DappWalletCoinDao.xml
index 87a7f49..b337946 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} for update
+        select * from dapp_wallet_coin where member_id=#{memberId}
     </select>
 
     <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity">
@@ -141,7 +141,30 @@
             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>
+
+    <select id="selectTotal" resultType="java.math.BigDecimal">
+        select IFNULL(sum(IFNULL(total_amount,0)),0)
+        from dapp_wallet_coin
+    </select>
+
+    <select id="selectWithdrawAmountByType" resultType="java.math.BigDecimal">
+        select IFNULL(sum(IFNULL(amount,0)),0)
+        from member_coin_withdraw
+        where 1=1
+        <if test='type == "D"'>
+            and date_format(CREATE_TIME, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d');
+        </if>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1