Răsfoiți Sursa

add 平台统计

xuhaifeng 2 luni în urmă
părinte
comite
15a7901705

+ 68 - 84
yiqi-admin/src/main/java/com/yiqi/admin/controller/settlement/PlatformStatisticsController.java

@@ -6,16 +6,17 @@ import com.yiqi.common.core.domain.AjaxResult;
 import com.yiqi.common.core.page.TableDataInfo;
 import com.yiqi.common.utils.DateUtils;
 import com.yiqi.common.utils.poi.ExcelUtil;
+import com.yiqi.core.domain.SettlementStoreStatistics;
 import com.yiqi.core.service.ISettlementFactoryStatisticsService;
 import com.yiqi.core.service.ISettlementStoreClothStatisticsService;
+import com.yiqi.core.service.ISettlementStoreStatisticsService;
 import com.yiqi.order.domain.dto.SettlementFactoryStatisticsDto;
+import com.yiqi.settlement.domain.dto.StoreChargeStatistics;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 平台统计报表
@@ -30,112 +31,95 @@ public class PlatformStatisticsController extends BaseController {
     @Autowired
     private ISettlementStoreClothStatisticsService settlementStoreClothStatisticsService;
 
+    @Autowired
+    private ISettlementStoreStatisticsService settlementStoreStatisticsService;
+
     /**
      * 获取工厂端首页总收益数据
      */
     @GetMapping("/dashborad")
     public AjaxResult dashboard() {
-        SettlementFactoryStatisticsDto settlementFactoryStatisticsDto = settlementStoreClothStatisticsService.totalByCondition(getFactoryId(), null, null, null);
-        return AjaxResult.success(settlementFactoryStatisticsDto);
+        // 获取订单统计数据
+        SettlementStoreStatistics orderStats = settlementStoreStatisticsService.orderTotal(null, null);
+
+        // 获取充值统计数据
+        StoreChargeStatistics chargeStats = settlementStoreStatisticsService.chargeTotal(null);
+
+        Map<String, Object> result = new HashMap<>();
+        result.put("orderStats", orderStats);
+        result.put("chargeStats", chargeStats);
+
+        return AjaxResult.success(result);
     }
 
     /**
-     * 获取门店每日交易统计列表
+     * 获取门店经营日报趋势数据
      */
-    @GetMapping("/list/bydate")
-    public TableDataInfo generateFactoryStatisticsByDate(@RequestParam(required = false) String startDate,
-                                                         @RequestParam(required = false) String endDate,
-                                                         @RequestParam(required = false) Long storeId,
-                                                         @RequestParam(defaultValue = "1") Integer pageNum,
-                                                         @RequestParam(defaultValue = "10") Integer pageSize) {
+    @GetMapping("/trend")
+    public AjaxResult getDailyTrend(@RequestParam("startDate") String startDate,
+                                    @RequestParam("endDate") String endDate) {
+        Date start = DateUtils.parseDate(startDate);
+        Date end = DateUtils.parseDate(endDate);
+        // 获取订单统计趋势
+        List<SettlementStoreStatistics> orderTrend = settlementStoreStatisticsService.generatePlatformStatisticsByDate(start, end);
 
-        Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -14);
-        Date end = endDate != null ? DateUtils.parseDate(endDate) : new Date();
-        List<SettlementFactoryStatisticsDto> statisticsList = settlementFactoryStatisticsService
-                .generateFactoryStatisticsByDate(getLoginUser().getOrgId(), storeId, start, end, pageNum, pageSize);
-        Long totalCount = (long) statisticsList.size();
-        // 4. 处理分页
-        if (pageNum != null && pageSize != null && pageNum > 0 && pageSize > 0) {
-            int startIndex = (pageNum - 1) * pageSize;
-            int endIndex = Math.min(startIndex + pageSize, statisticsList.size());
-            if (startIndex >= statisticsList.size()) {
-                statisticsList = Collections.emptyList();
-            }
-            statisticsList = statisticsList.subList(startIndex, endIndex);
-        }
-        return getDataTable(statisticsList, totalCount);
-    }
+        // 获取充值统计趋势
+        List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByDate(0L, start, end);
 
+        Map<String, Object> result = new HashMap<>();
+        result.put("orderTrend", orderTrend);
+        result.put("chargeTrend", chargeTrend);
 
-    /**
-     * 获取门店每日充值统计列表
-     */
-    @GetMapping("/list/bystore")
-    public TableDataInfo generateFactoryStatisticsByStore(@RequestParam(required = false) String startDate,
-                                                          @RequestParam(required = false) String endDate,
-                                                          @RequestParam(required = false) Long storeId,
-                                                          @RequestParam(defaultValue = "1") Integer pageNum,
-                                                          @RequestParam(defaultValue = "15") Integer pageSize) {
-        Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -14);
-        Date end = endDate != null ? DateUtils.parseDate(endDate) : new Date();
-        List<SettlementFactoryStatisticsDto> statisticsList = settlementFactoryStatisticsService
-                .generateFactoryStatisticsByStoreId(getLoginUser().getOrgId(), storeId, start, end);
-        Long totalCount = (long) statisticsList.size();
-        // 4. 处理分页
-        if (pageNum != null && pageSize != null && pageNum > 0 && pageSize > 0) {
-            int startIndex = (pageNum - 1) * pageSize;
-            int endIndex = Math.min(startIndex + pageSize, statisticsList.size());
-            if (startIndex >= statisticsList.size()) {
-                statisticsList = Collections.emptyList();
-            }
-            statisticsList = statisticsList.subList(startIndex, endIndex);
-        }
-        return getDataTable(statisticsList, totalCount);
+        return AjaxResult.success(result);
     }
 
     /**
-     * 获取门店每日充值统计列表
+     * 获取门店每日交易统计列表
      */
-    @GetMapping("/total")
-    public AjaxResult generateFactoryStatistics(@RequestParam(required = false) String startDate,
-                                                @RequestParam(required = false) String endDate,
-                                                @RequestParam(required = false) Long storeId,
-                                                @RequestParam(defaultValue = "1") Integer pageNum,
-                                                @RequestParam(defaultValue = "15") Integer pageSize) {
-        Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -14);
-        Date end = endDate != null ? DateUtils.parseDate(endDate) : new Date();
-        SettlementFactoryStatisticsDto settlementFactoryStatisticsDto = settlementFactoryStatisticsService
-                .generateTotalFactoryStatistics(getLoginUser().getOrgId(), storeId, start, end);
-        return AjaxResult.success(settlementFactoryStatisticsDto);
+    @GetMapping("/order/list")
+    public AjaxResult list(@RequestParam(required = false) String startDate,
+                           @RequestParam(required = false) String endDate,
+                           @RequestParam(defaultValue = "1") Integer pageNum,
+                           @RequestParam(defaultValue = "15") Integer pageSize) {
+
+        Date start = DateUtils.parseDate(startDate);
+        Date end = DateUtils.parseDate(endDate);
+        // 获取订单统计趋势
+        List<SettlementStoreStatistics> orderTrend = settlementStoreStatisticsService.generatePlatformStatisticsByDate(start, end);
+        return AjaxResult.success(orderTrend);
     }
 
     /**
-     *
+     * 获取门店每日充值统计列表
      */
-    @PostMapping("/export/bystore")
-    public void chargeExport(HttpServletResponse response, @RequestParam(required = false) String startDate,
-                             @RequestParam(required = false) String endDate,
-                             @RequestParam(required = false) Long storeId) {
-        Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -14);
-        Date end = endDate != null ? DateUtils.parseDate(endDate) : new Date();
-        List<SettlementFactoryStatisticsDto> list = settlementFactoryStatisticsService
-                .generateFactoryStatisticsByStoreId(getLoginUser().getOrgId(), storeId, start, end);
-        ExcelUtil<SettlementFactoryStatisticsDto> util = new ExcelUtil<>(SettlementFactoryStatisticsDto.class);
-        util.exportExcel(response, list, "工厂门店报表统计");
+    @GetMapping("/charge/list")
+    public AjaxResult chargeList(@RequestParam(required = false) String startDate,
+                                 @RequestParam(required = false) String endDate,
+                                 @RequestParam(required = false) Integer sort,
+                                 @RequestParam(defaultValue = "1") Integer pageNum,
+                                 @RequestParam(defaultValue = "15") Integer pageSize) {
+        Date start = DateUtils.parseDate(startDate);
+        Date end = DateUtils.parseDate(endDate);
+
+        // 获取充值统计趋势
+        List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByDate(0L, start, end);
+        return AjaxResult.success(chargeTrend);
     }
 
     /**
-     * 导出门店每日交易统计
+     * 获取门店每日订单统计列表
      */
-    @PostMapping("/export/bydate")
-    public void export(HttpServletResponse response, @RequestParam(required = false) String startDate,
-                       @RequestParam(required = false) String endDate,
-                       @RequestParam(required = false) Long storeId) {
+    @GetMapping("/order/bystore")
+    public TableDataInfo generateStatisticsByStore(@RequestParam(required = false) String startDate,
+                                                   @RequestParam(required = false) String endDate,
+                                                   @RequestParam(required = false) Long storeId,
+                                                   @RequestParam(defaultValue = "1") Integer pageNum,
+                                                   @RequestParam(defaultValue = "15") Integer pageSize) {
         Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -14);
         Date end = endDate != null ? DateUtils.parseDate(endDate) : new Date();
-        List<SettlementFactoryStatisticsDto> list = settlementFactoryStatisticsService
-                .generateFactoryStatisticsByDate(getLoginUser().getOrgId(), storeId, start, end, 1, 1000);
-        ExcelUtil<SettlementFactoryStatisticsDto> util = new ExcelUtil<>(SettlementFactoryStatisticsDto.class);
-        util.exportExcel(response, list, "工厂每日报表统计");
+        startPage();
+        List<SettlementStoreStatistics> settlementStoreStatistics = settlementStoreStatisticsService.generatePlatformStatisticsByStore(start, end);
+        return getDataTable(settlementStoreStatistics);
     }
+
 }

+ 8 - 0
yiqi-common/src/main/java/com/yiqi/core/service/ISettlementManageBillService.java

@@ -27,6 +27,14 @@ public interface ISettlementManageBillService extends IService<SettlementManageB
     StoreBillStatistics storeBillSettlement(Long storeId, Date startTime, Date endTime);
 
 
+    /**
+     * @param startTime
+     * @param endTime
+     * @desc 平台订单结算统计
+     */
+    StoreBillStatistics platformBillSettlement(Date startTime, Date endTime);
+
+
     /**
      * @param storeId
      * @param startTime

+ 16 - 1
yiqi-common/src/main/java/com/yiqi/core/service/ISettlementStoreStatisticsService.java

@@ -27,11 +27,26 @@ public interface ISettlementStoreStatisticsService extends IService<SettlementSt
     /**
      * 查询门店每日统计列表
      *
-     * @param settlementStoreStatistics 门店每日统计
      * @return 门店每日统计集合
      */
     List<SettlementStoreStatistics> generateStoreStatisticsByDate(Long storeId, Date start, Date end);
 
+
+    /**
+     * 平台每日统计列表
+     *
+     * @return 门店每日统计集合
+     */
+    List<SettlementStoreStatistics> generatePlatformStatisticsByDate(Date start, Date end);
+
+
+    /**
+     * 平台每日统计列表 (按门店)
+     *
+     * @return 门店每日统计集合
+     */
+    List<SettlementStoreStatistics> generatePlatformStatisticsByStore(Date start, Date end);
+
     /**
      * 生成每日统计数据*
      *

+ 18 - 0
yiqi-core/src/main/java/com/yiqi/core/mapper/SettlementStoreStatisticsMapper.java

@@ -56,4 +56,22 @@ public interface SettlementStoreStatisticsMapper extends BaseMapper<SettlementSt
      * @return 结果
      */
     StoreChargeStatistics chargeTotal(@Param("storeId") Long storeId);
+
+    /**
+     * 查询订单统计
+     *
+     * @param startDay 开始日期
+     * @param endDay   结束日期
+     * @return 结果
+     */
+    List<SettlementStoreStatistics> totalByDate(@Param("startDay") Integer startDay, @Param("endDay") Integer endDay);
+
+    /**
+     * 查询订单统计
+     *
+     * @param startDay 开始日期
+     * @param endDay   结束日期
+     * @return 结果
+     */
+    List<SettlementStoreStatistics> totalByStore(@Param("startDay") Integer startDay, @Param("endDay") Integer endDay);
 }

+ 36 - 0
yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementManageBillServiceImpl.java

@@ -195,6 +195,42 @@ public class SettlementManageBillServiceImpl extends ServiceImpl<SettlementManag
         return saveStatisticsResult(storeId, startTime, endTime, clothStats, goodsStats, paymentStats);
     }
 
+    @Override
+    public StoreBillStatistics platformBillSettlement(Date startTime, Date endTime) {
+        // 1. 查询洗衣订单
+        List<OrderCloth> orderClothList = new ArrayList<>();
+
+        // 2. 查询商品订单
+        List<OrderGoods> orderGoodsList = orderGoodsService.list(new QueryWrapper<OrderGoods>().lambda()
+                .ne(OrderGoods::getOrderStatus, OrderGoodsStatusType.CANCEL_ORDER.getCode())
+                .eq(OrderGoods::getSourceType, SourceType.MANAGER.getCode())
+                .isNull(OrderGoods::getOrgId)
+                .between(OrderGoods::getCreateTime, startTime, endTime));
+
+        // 3. 查询衣服退款记录
+        List<OrderClothRefund> clothRefundList = new ArrayList<>();
+
+        // 4. 查询商品退款记录
+        List<OrderGoodsRefund> goodsRefundList = orderGoodsRefundService.list(new QueryWrapper<OrderGoodsRefund>().lambda()
+                .isNull(OrderGoodsRefund::getOrgId)
+                .eq(OrderGoodsRefund::getSourceType, SourceType.MANAGER.getCode())
+                .eq(OrderGoodsRefund::getRefundStatus, OrderRefundStatus.REFUND_SUCCESS.getCode())
+                .between(OrderGoodsRefund::getRefundTime, startTime, endTime));
+
+        // 5. 统计洗衣订单数据
+        OrderStatisticsVO clothStats = calculateClothOrderStats(orderClothList, clothRefundList);
+
+        // 6. 统计商品订单数据
+        OrderStatisticsVO goodsStats = calculateGoodsOrderStats(orderGoodsList, goodsRefundList);
+
+        // 7. 汇总支付方式统计
+        PaymentStatisticsVO paymentStats = calculatePaymentStats(clothStats, goodsStats);
+
+        // 8. 保存统计结果
+        return saveStatisticsResult(0L, startTime, endTime, clothStats, goodsStats, paymentStats);
+    }
+
+
     /**
      * 计算洗衣订单统计数据
      */

+ 53 - 7
yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementStoreStatisticsServiceImpl.java

@@ -77,6 +77,26 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
         return result;
     }
 
+    @Override
+    public List<SettlementStoreStatistics> generatePlatformStatisticsByDate(Date start, Date end) {
+        Integer startDay = Integer.parseInt(DateUtil.format(start, "yyyyMMdd"));
+        Integer endDay = Integer.parseInt(DateUtil.format(end, "yyyyMMdd"));
+        List<SettlementStoreStatistics> result = baseMapper.totalByDate(startDay, endDay);
+        return result;
+    }
+
+    @Override
+    public List<SettlementStoreStatistics> generatePlatformStatisticsByStore(Date start, Date end) {
+        Integer startDay = Integer.parseInt(DateUtil.format(start, "yyyyMMdd"));
+        Integer endDay = Integer.parseInt(DateUtil.format(end, "yyyyMMdd"));
+        List<SettlementStoreStatistics> result = baseMapper.totalByStore(startDay, endDay);
+        for (SettlementStoreStatistics settlementStoreStatistics : result) {
+            settlementStoreStatistics.setStoreName(storeService.getById(settlementStoreStatistics.getStoreId()).getName());
+        }
+        return result;
+    }
+
+
     @Override
     public List<SettlementStoreStatistics> generateStoreStatisticsByStore(Date start) {
         Integer startDay = Integer.parseInt(DateUtil.format(start, "yyyyMMdd"));
@@ -117,6 +137,23 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
                 baseMapper.insert(settlementStoreStatistics);
             }
         }
+        //生成平台商品统计
+        SettlementStoreStatistics settlementStoreStatistics = generateStoreStatistics(date, 0L);
+        // 2.6 检查是否已存在当日统计数据
+        QueryWrapper<SettlementStoreStatistics> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda()
+                .eq(SettlementStoreStatistics::getStoreId, 0L)
+                .eq(SettlementStoreStatistics::getDay, settlementStoreStatistics.getDay());
+
+        SettlementStoreStatistics existStatistics = baseMapper.selectOne(queryWrapper);
+        if (existStatistics != null) {
+            // 更新已存在的统计数据
+            settlementStoreStatistics.setId(existStatistics.getId());
+            baseMapper.updateById(settlementStoreStatistics);
+        } else {
+            // 插入新的统计数据
+            baseMapper.insert(settlementStoreStatistics);
+        }
     }
 
     @Override
@@ -133,11 +170,20 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
     @Override
     public SettlementStoreStatistics generateStoreStatistics(Date date, Long storeId) {
         // 2.1 获取门店当日统计数据
-        StoreBillStatistics statistics = settlementManageBillService.storeBillSettlement(
-                storeId,
-                DateUtils.getStartTime(date),
-                DateUtils.getEndTime(date)
-        );
+        StoreBillStatistics statistics = null;
+        if (storeId == 0L) {
+            //获取平台统计
+            statistics = settlementManageBillService.platformBillSettlement(
+                    DateUtils.getStartTime(date),
+                    DateUtils.getEndTime(date)
+            );
+        } else {
+            statistics = settlementManageBillService.storeBillSettlement(
+                    storeId,
+                    DateUtils.getStartTime(date),
+                    DateUtils.getEndTime(date)
+            );
+        }
 
         // 2.2 构建门店统计实体
         SettlementStoreStatistics storeStatistics = new SettlementStoreStatistics();
@@ -218,14 +264,14 @@ public class SettlementStoreStatisticsServiceImpl extends ServiceImpl<Settlement
         try {
             // 1. 查询门店当日充值记录
             List<OrderRecharge> rechargeList = orderRechargeService.list(new QueryWrapper<OrderRecharge>().lambda()
-                    .eq(OrderRecharge::getStoreId, storeId)
+                    .eq(storeId != 0L, OrderRecharge::getStoreId, storeId)
                     .eq(OrderRecharge::getPayStatus, PayStatus.HAS_PAY.getCode())
                     .eq(OrderRecharge::getDelFlag, StatusType.OK.getCode())
                     .between(OrderRecharge::getPayTime, startDate, endDate));
 
             // 2. 查询门店当日充值退款记录
             List<OrderRechargeRefund> refundList = orderRechargeRefundService.list(new QueryWrapper<OrderRechargeRefund>().lambda()
-                    .eq(OrderRechargeRefund::getStoreId, storeId)
+                    .eq(storeId != 0L, OrderRechargeRefund::getStoreId, storeId)
                     .eq(OrderRechargeRefund::getRefundStatus, RechargeRefundStatusType.REFUND_AGREE.getCode())
                     .eq(OrderRechargeRefund::getDelFlag, StatusType.OK.getCode())
                     .between(OrderRechargeRefund::getRefundTime, startDate, endDate));

+ 75 - 0
yiqi-core/src/main/resources/mapper/core/SettlementStoreStatisticsMapper.xml

@@ -294,5 +294,80 @@
         ) refund;
     </select>
 
+    <select id="totalByDate" resultType="com.yiqi.core.domain.SettlementStoreStatistics">
+        select
+            day,
+            sum(cloth_order_amount) as clothOrderAmount,
+            sum(cloth_appoint_count) as clothAppointCount,
+            sum(cloth_receive_amount) as clothReceiveAmount,
+            sum(cloth_refund_amount) as clothRefundAmount,
+            sum(cloth_order_count) as clothOrderCount,
+            sum(cloth_count) as clothCount,
+            sum(cloth_alipay_amount) as clothAlipayAmount,
+            sum(cloth_wechat_amount) as clothWechatAmount,
+            sum(cloth_cash_amount) as clothCashAmount,
+            sum(cloth_union_amount) as clothUnionAmount,
+            sum(cloth_member_amount) as clothMemberAmount,
+            sum(cloth_alipay_refund_amount) as clothAlipayRefundAmount,
+            sum(cloth_wechat_refund_amount) as clothWechatRefundAmount,
+            sum(cloth_cash_refund_amount) as clothCashRefundAmount,
+            sum(cloth_union_refund_amount) as clothUnionRefundAmount,
+            sum(cloth_member_refund_amount) as clothMemberRefundAmount,
+            sum(goods_order_amount) as goodsOrderAmount,
+            sum(goods_receive_amount) as goodsReceiveAmount,
+            sum(goods_refund_amount) as goodsRefundAmount,
+            sum(goods_order_count) as goodsOrderCount,
+            sum(goods_count) as goodsCount,
+            sum(goods_alipay_amount) as goodsAlipayAmount,
+            sum(goods_wechat_amount) as goodsWechatAmount,
+            sum(goods_cash_amount) as goodsCashAmount,
+            sum(goods_union_amount) as goodsUnionAmount,
+            sum(goods_member_amount) as goodsMemberAmount,
+            sum(goods_order_refund_amount) as goodsOrderRefundAmount,
+            sum(goods_alipay_refund_amount) as goodsAlipayRefundAmount,
+            sum(goods_wechat_refund_amount) as goodsWechatRefundAmount,
+            sum(goods_cash_refund_amount) as goodsCashRefundAmount,
+            sum(goods_union_refund_amount) as goodsUnionRefundAmount,
+            sum(goods_member_refund_amount) as goodsMemberRefundAmount
+        from settlement_store_statistics where day >= #{startDay} and day &lt;= #{endDay} group by day order by day asc
+    </select>
+    <select id="totalByStore" resultType="com.yiqi.core.domain.SettlementStoreStatistics">
+        select
+            store_id as storeId,
+            sum(cloth_order_amount) as clothOrderAmount,
+            sum(cloth_appoint_count) as clothAppointCount,
+            sum(cloth_receive_amount) as clothReceiveAmount,
+            sum(cloth_refund_amount) as clothRefundAmount,
+            sum(cloth_order_count) as clothOrderCount,
+            sum(cloth_count) as clothCount,
+            sum(cloth_alipay_amount) as clothAlipayAmount,
+            sum(cloth_wechat_amount) as clothWechatAmount,
+            sum(cloth_cash_amount) as clothCashAmount,
+            sum(cloth_union_amount) as clothUnionAmount,
+            sum(cloth_member_amount) as clothMemberAmount,
+            sum(cloth_alipay_refund_amount) as clothAlipayRefundAmount,
+            sum(cloth_wechat_refund_amount) as clothWechatRefundAmount,
+            sum(cloth_cash_refund_amount) as clothCashRefundAmount,
+            sum(cloth_union_refund_amount) as clothUnionRefundAmount,
+            sum(cloth_member_refund_amount) as clothMemberRefundAmount,
+            sum(goods_order_amount) as goodsOrderAmount,
+            sum(goods_receive_amount) as goodsReceiveAmount,
+            sum(goods_refund_amount) as goodsRefundAmount,
+            sum(goods_order_count) as goodsOrderCount,
+            sum(goods_count) as goodsCount,
+            sum(goods_alipay_amount) as goodsAlipayAmount,
+            sum(goods_wechat_amount) as goodsWechatAmount,
+            sum(goods_cash_amount) as goodsCashAmount,
+            sum(goods_union_amount) as goodsUnionAmount,
+            sum(goods_member_amount) as goodsMemberAmount,
+            sum(goods_order_refund_amount) as goodsOrderRefundAmount,
+            sum(goods_alipay_refund_amount) as goodsAlipayRefundAmount,
+            sum(goods_wechat_refund_amount) as goodsWechatRefundAmount,
+            sum(goods_cash_refund_amount) as goodsCashRefundAmount,
+            sum(goods_union_refund_amount) as goodsUnionRefundAmount,
+            sum(goods_member_refund_amount) as goodsMemberRefundAmount
+        from settlement_store_statistics where day >= #{startDay} and day &lt;= #{endDay} and store_id !=0 group by store_id order by clothOrderAmount desc
+    </select>
+
 
 </mapper>