From 8d053c03d0738efabc33183c1db20e05ced5cfb0 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Thu, 25 Nov 2021 16:01:23 +0800
Subject: [PATCH] fix
---
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