From 045706342fff432097777529ea307b466cd77b07 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 30 Dec 2020 17:01:55 +0800
Subject: [PATCH] modify
---
zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java | 2 ++
zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java | 8 ++++----
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml | 40 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
index 6bfd592..83a3a5a 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
@@ -86,9 +86,9 @@
case "5" :
return tjVipSumDao.selectFreeConsume(timeSpaceParam, shopId, null);
case "6" :
- return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null);
+ return tjVipSumDao.selectCashRefund(timeSpaceParam, shopId, null);
case "7" :
- return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null);
+ return tjVipSumDao.selectCardRefund(timeSpaceParam, shopId, null);
case "8" :
return tjVipSumDao.selectArrears(timeSpaceParam, shopId, null);
default :
@@ -112,9 +112,9 @@
case "5" :
return tjVipSumDao.selectFreeConsume(timeSpaceParam, null, companyId);
case "6" :
- return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId);
+ return tjVipSumDao.selectCashRefund(timeSpaceParam, null, companyId);
case "7" :
- return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId);
+ return tjVipSumDao.selectCardRefund(timeSpaceParam, null, companyId);
case "8" :
return tjVipSumDao.selectArrears(timeSpaceParam, null, companyId);
default :
diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
index 9ccc077..1e260ee 100644
--- a/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
@@ -29,4 +29,6 @@
Map<String, BigDecimal> selectHisConsume(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
Map<String, BigDecimal> selectFreeConsume(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
+ Map<String, BigDecimal> selectCardRefund(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
+ Map<String, BigDecimal> selectCashRefund(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
}
\ No newline at end of file
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
index 5c73b36..0fdc2aa 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
@@ -187,5 +187,45 @@
from area where id=1
</select>
+ <select id="selectCashRefund" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select IFNULL(sum(cash_Pay), 0)
+ from sys_order
+ where STATU in ('退款')
+ and <![CDATA[order_time > #{item.beginTime} and order_time < #{item.endTime} ]]>
+ <if test="companyId != null and companyId != 0">
+ and company_id=#{companyId}
+ </if>
+ <if test="shopId !=null and shopId !=0 " >
+ and SHOP_ID = #{shopId}
+ </if>
+ ) as t${index}
+
+ </foreach>
+ from area where id=1
+ </select>
+
+
+ <select id="selectCardRefund" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select IFNULL(sum(card_Pay), 0)
+ from sys_order
+ where STATU in ('退款')
+ and <![CDATA[order_time > #{item.beginTime} and order_time < #{item.endTime} ]]>
+ <if test="companyId != null and companyId != 0">
+ and company_id=#{companyId}
+ </if>
+ <if test="shopId !=null and shopId !=0 " >
+ and SHOP_ID = #{shopId}
+ </if>
+ ) as t${index}
+
+ </foreach>
+ from area where id=1
+ </select>
</mapper>
--
Gitblit v1.9.1