From aa861e83f2a7a5f99ed30d448c129c2032b71af6 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 09 May 2023 09:39:58 +0800
Subject: [PATCH] 微信支付

---
 src/main/resources/mapper/modules/MallMemberWalletMapper.xml |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/modules/MallMemberWalletMapper.xml b/src/main/resources/mapper/modules/MallMemberWalletMapper.xml
index cc3b0b8..35bbcb1 100644
--- a/src/main/resources/mapper/modules/MallMemberWalletMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberWalletMapper.xml
@@ -13,10 +13,51 @@
         where id=#{record.id} and revision=#{record.revision}
     </update>
 
+    <update id="updateCommissionWithVersion">
+        update mall_member_wallet
+        set revision = revision + 1,
+            commission = #{record.commission}
+        where id=#{record.id} and revision=#{record.revision}
+    </update>
+
     <update id="updateBalanceWithId">
         update mall_member_wallet
         set revision = revision + 1,
             balance = #{record.balance}
         where id=#{record.id}
     </update>
+
+    <update id="updateAmountWithVersion">
+        update mall_member_wallet
+        set revision = revision + 1
+        <if test="record.balance != null">
+            , balance = #{record.balance}
+        </if>
+        <if test="record.score != null">
+            , score = #{record.score}
+        </if>
+        <if test="record.prizeScore != null">
+            , prize_score = #{record.prizeScore}
+        </if>
+        <if test="record.commission != null">
+            , commission = #{record.commission}
+        </if>
+        where id=#{record.id} and revision=#{record.revision}
+    </update>
+
+    <select id="selectSumBalance" resultType="java.math.BigDecimal">
+        select ifnull(sum(balance),0) total from mall_member_wallet
+    </select>
+
+    <select id="selectSumScore" resultType="java.math.BigDecimal">
+        select ifnull(sum(score),0) total from mall_member_wallet
+    </select>
+
+    <select id="selectSumPrizeScore" resultType="java.math.BigDecimal">
+        select ifnull(sum(prize_score),0) total from mall_member_wallet
+    </select>
+
+    <select id="selectSumCommission" resultType="java.math.BigDecimal">
+        select ifnull(sum(commission),0) total from mall_member_wallet
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1