From 45b922e93d8cf867a46f15d1db30c7e380e965b1 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Tue, 24 Nov 2020 10:25:48 +0800 Subject: [PATCH] modify --- 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