From 05a82deffa89a22fa35abaa9196053f43cbc1103 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Fri, 27 May 2022 19:51:07 +0800 Subject: [PATCH] fix --- zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml | 6 ++++++ zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java | 2 ++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java index 7a26149..820f0c4 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java @@ -35,5 +35,7 @@ public MoneyCardUseFlow selectById(Long id); int updateVipCardId(@Param("vipId") Long vipId, @Param("cardId") Long cardId); + + double selectCardUseAmount(Long cardId); } \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml index 96da104..8ab6258 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml @@ -366,6 +366,12 @@ set car_use_id=#{cardId} where vip_id=#{vipId} and type='会员充值' </update> + + <select id="selectCardUseAmount" resultType="java.lang.Double"> + select IFNULL(ABS(sum(IFNULL(total, 0))), 0) + from money_card_use_flow + where car_use_id=#{cardId} and type='消费扣款' + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.1