update 获取累计充值金额

This commit is contained in:
2024-03-04 16:34:55 +08:00
parent b88fdb0467
commit 7c6b7eab72
5 changed files with 60 additions and 8 deletions

View File

@@ -203,6 +203,24 @@
</select>
<select id="selectMemberWalletInfo" resultType="com.jsowell.pile.vo.base.MemberWalletVO">
SELECT t1.member_id as memberId,
t1.wallet_code as walletCode,
t1.merchant_id as merchantId,
t1.principal_balance as principalBalance,
t1.gift_balance as giftBalance,
t2.accumulatedRechargeAmount as accumulatedRechargeAmount,
t3.accumulatedRechargeGift as accumulatedRechargeGift
from member_wallet_info t1
left join (select wallet_code, sum(amount) as accumulatedRechargeAmount
from `member_wallet_log`
WHERE `wallet_code` = #{walletCode,jdbcType=VARCHAR}
and type = '1'
and sub_type = '10') t2 on t2.wallet_code = t1.wallet_code
left join (select wallet_code, sum(amount) as accumulatedRechargeGift
from `member_wallet_log`
WHERE `wallet_code` = #{walletCode,jdbcType=VARCHAR}
and type = '1'
and sub_type = '11') t3 on t3.wallet_code = t1.wallet_code
where t1.wallet_code = #{walletCode,jdbcType=VARCHAR}
</select>
</mapper>