From e423d56d730db1baed24f3f7dbbc4141038776b6 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Fri, 18 Jun 2021 22:12:03 +0800
Subject: [PATCH] 修复每日业绩bug和优化赠送业绩计算方式
---
zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
index 2cfc1a1..ddb5b13 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
@@ -636,7 +636,7 @@
)totalPay,
(select IFNULL(sum(a.amount),0) from sys_order_flow a
inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
- where a.pay_method not in ('储值卡', '欠款') and a.flow_type != '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+ where a.pay_method not in ('储值卡', '欠款') and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
<if test="shopId != null">
and a.shop_id=#{shopId}
</if>
@@ -716,6 +716,28 @@
and a.company_id=#{companyId}
</if>
) refund,
+ (select sum(IFNULL(amount, 0))
+ from sys_order_flow a
+ inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
+ where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+ <if test="shopId != null">
+ and a.shop_id=#{shopId}
+ </if>
+ <if test="companyId != null">
+ and a.company_id=#{companyId}
+ </if>
+ ) cardAmount,
+ (select sum(IFNULL(amount, 0))
+ from sys_order_flow a
+ inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
+ where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+ <if test="shopId != null">
+ and a.shop_id=#{shopId}
+ </if>
+ <if test="companyId != null">
+ and a.company_id=#{companyId}
+ </if>
+ ) cardFreeAmount,
(select IFNULL(count(1),0) from sys_order
where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]>
<if test="shopId != null">
--
Gitblit v1.9.1