From 836e019db92b9871cba9d440c8159b35f79e1726 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 30 Mar 2023 09:32:42 +0800 Subject: [PATCH] 根据补贴记录,减少用户贡献值 --- src/main/resources/mapper/modules/MallMemberWalletMapper.xml | 68 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/modules/MallMemberWalletMapper.xml b/src/main/resources/mapper/modules/MallMemberWalletMapper.xml index 35bbcb1..ac0aa70 100644 --- a/src/main/resources/mapper/modules/MallMemberWalletMapper.xml +++ b/src/main/resources/mapper/modules/MallMemberWalletMapper.xml @@ -42,6 +42,12 @@ <if test="record.commission != null"> , commission = #{record.commission} </if> + <if test="record.totalScore != null"> + , total_score = #{record.totalScore} + </if> + <if test="record.star != null"> + , star = #{record.star} + </if> where id=#{record.id} and revision=#{record.revision} </update> @@ -60,4 +66,66 @@ <select id="selectSumCommission" resultType="java.math.BigDecimal"> select ifnull(sum(commission),0) total from mall_member_wallet </select> + + <select id="selectMemberWalletsByIds" resultType="cc.mrbird.febs.mall.entity.MallMemberWallet"> + select * from mall_member_wallet + where member_id IN + <foreach collection = "list" item = "item" separator="," open = "(" close = ")" > + #{item} + </foreach > + </select> + + <update id="updateStarByList" parameterType="java.util.List" > + <foreach collection="list" item="item" index="index" open="" close="" separator=";"> + update mall_member_wallet + <set> + balance = balance + #{item.starPerkAmount}, + </set> + WHERE id = #{item.id} + </foreach> + </update> + + <update id="updateTotalScoreByList" parameterType="java.util.List" > + <foreach collection="list" item="item" index="index" open="" close="" separator=";"> + update mall_member_wallet + <set> + total_score = total_score - #{item.starPerkAmount}, + </set> + WHERE id = #{item.id} + </foreach> + </update> + + <update id="reduceTotalScoreById"> + update mall_member_wallet + <set> + total_score = total_score - #{totalScore}, + </set> + WHERE id = #{id} + </update> + + <update id="addBalanceById"> + update mall_member_wallet + <set> + balance = balance + #{balance}, + </set> + WHERE id = #{id} + </update> + + <update id="addStarByMemberId"> + update mall_member_wallet + <set> + star = star + #{star}, + </set> + WHERE member_id = #{memberId} + </update> + + <update id="reduceStarByMemberId"> + update mall_member_wallet + <set> + star = star - #{star}, + </set> + WHERE member_id = #{memberId} + </update> + + </mapper> \ No newline at end of file -- Gitblit v1.9.1