From af0755c3e91932be6271cad9d5345ce9f335e817 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 25 Feb 2022 13:20:31 +0800
Subject: [PATCH] 20222223
---
src/main/resources/mapper/member/MemberWalletCoinDao.xml | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/member/MemberWalletCoinDao.xml b/src/main/resources/mapper/member/MemberWalletCoinDao.xml
index 79979c5..ff0d8b4 100644
--- a/src/main/resources/mapper/member/MemberWalletCoinDao.xml
+++ b/src/main/resources/mapper/member/MemberWalletCoinDao.xml
@@ -39,5 +39,27 @@
where id=#{id}
</update>
+ <update id="updateWalletBalance" parameterType="map">
+ update member_wallet_coin
+ <set>
+ <if test="availableBalance != null">
+ available_balance = (
+ case when IFNULL(available_balance, 0) + #{availableBalance}>0 then IFNULL(available_balance, 0) + #{availableBalance} else 0 end
+ ),
+ </if>
+ <if test="totalBalance != null">
+ total_balance = (
+ case when IFNULL(total_balance, 0) + #{totalBalance}>0 then IFNULL(total_balance, 0) + #{totalBalance} else 0 end
+ ),
+ </if>
+ <if test="frozenBalance != null">
+ frozen_balance = (
+ case when IFNULL(frozen_balance, 0) + #{frozenBalance}>0 then IFNULL(frozen_balance, 0) + #{frozenBalance} else 0 end
+ ),
+ </if>
+ </set>
+ where id=#{id}
+ </update>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1