From b3c537d034149cdc88af2f239f32230b6697d272 Mon Sep 17 00:00:00 2001 From: Chopper Date: Fri, 2 Sep 2022 19:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=9F=E8=AE=A1=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E4=BA=BA=E6=95=B0bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/StoreFlowStatisticsMapper.java | 28 ++++++++++++++++++- .../StoreFlowStatisticsServiceImpl.java | 14 ++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/statistics/mapper/StoreFlowStatisticsMapper.java b/framework/src/main/java/cn/lili/modules/statistics/mapper/StoreFlowStatisticsMapper.java index 55496565..747534f9 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/mapper/StoreFlowStatisticsMapper.java +++ b/framework/src/main/java/cn/lili/modules/statistics/mapper/StoreFlowStatisticsMapper.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; +import java.util.Date; import java.util.List; /** @@ -41,7 +42,6 @@ public interface StoreFlowStatisticsMapper extends BaseMapper { List getCateGoryStatisticsData(@Param(Constants.WRAPPER) Wrapper queryWrapper); - /** * 店铺统计列表 * @@ -52,4 +52,30 @@ public interface StoreFlowStatisticsMapper extends BaseMapper { @Select("SELECT store_id AS storeId,store_name AS storeName,SUM(final_price) AS price,SUM(num) AS num FROM li_store_flow ${ew.customSqlSegment}") List getStoreStatisticsData(IPage page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + /** + * 店铺统计付款人数 + * + * @param storeId 店铺id + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 付款人数 + */ + @Select("SELECT count(0) AS num FROM (SELECT count(0) FROM li_store_flow " + + " where store_id = ${storeId} and flow_type='PAY' and create_time >=${startTime} and create_time < ${endTime}" + + " GROUP BY member_id) t") + Long countPayers(String storeId, Date startTime, Date endTime); + + /** + * 统计付款人数 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 付款人数 + */ + @Select("SELECT count(0) AS num FROM (SELECT count(0) FROM li_store_flow " + + " where flow_type='PAY' and create_time >=${startTime} and create_time < ${endTime}" + + " GROUP BY member_id) t") + Long countPayers(Date startTime, Date endTime); + + } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/StoreFlowStatisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/StoreFlowStatisticsServiceImpl.java index bb31a7d9..56139712 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/StoreFlowStatisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/StoreFlowStatisticsServiceImpl.java @@ -40,6 +40,7 @@ public class StoreFlowStatisticsServiceImpl extends ServiceImpl getGoodsStatisticsData(GoodsStatisticsQueryParam goodsStatisticsQueryParam, Integer num) { //获取查询条件 @@ -159,18 +160,13 @@ public class StoreFlowStatisticsServiceImpl extends ServiceImpl