获取Key 错误
This commit is contained in:
@@ -65,8 +65,7 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
|
|||||||
" tb_shop_order_statistic " +
|
" tb_shop_order_statistic " +
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" shop_id = #{shopId} " +
|
" shop_id = #{shopId} " +
|
||||||
" AND statistic_date > #{start} " +
|
" AND statistic_date BETWEEN #{start} AND #{end} ")
|
||||||
" AND statistic_date <= #{end} ")
|
|
||||||
ShopOrderStatistic countStatistic(Long shopId, LocalDate start, LocalDate end);
|
ShopOrderStatistic countStatistic(Long shopId, LocalDate start, LocalDate end);
|
||||||
//---------------------------------------------金额统计---------------------------------------------------
|
//---------------------------------------------金额统计---------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@@ -98,7 +97,7 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
|
|||||||
" tb_shop_order_statistic " +
|
" tb_shop_order_statistic " +
|
||||||
" WHERE" +
|
" WHERE" +
|
||||||
" shop_id = #{shopId} " +
|
" shop_id = #{shopId} " +
|
||||||
"and statistic_date > #{start} " +
|
"and statistic_date >= #{start} " +
|
||||||
"and statistic_date <= #{end} " +
|
"and statistic_date <= #{end} " +
|
||||||
"GROUP BY tradeDay")
|
"GROUP BY tradeDay")
|
||||||
List<TotalVo> getStatDateRange(Long shopId, LocalDate start, LocalDate end);
|
List<TotalVo> getStatDateRange(Long shopId, LocalDate start, LocalDate end);
|
||||||
@@ -135,7 +134,7 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
|
|||||||
" SUM(credit_pay_count) as creditPay " +
|
" SUM(credit_pay_count) as creditPay " +
|
||||||
" FROM tb_shop_order_statistic " +
|
" FROM tb_shop_order_statistic " +
|
||||||
" WHERE shop_id = #{shopId} " +
|
" WHERE shop_id = #{shopId} " +
|
||||||
" AND statistic_date > #{start} " +
|
" AND statistic_date >= #{start} " +
|
||||||
" AND statistic_date <= #{end} ")
|
" AND statistic_date <= #{end} ")
|
||||||
Map<String, BigDecimal> getPayTypeDateRangeRaw(Long shopId, LocalDate start, LocalDate end);
|
Map<String, BigDecimal> getPayTypeDateRangeRaw(Long shopId, LocalDate start, LocalDate end);
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
|
|||||||
startDate = currentDate.minusDays(29);
|
startDate = currentDate.minusDays(29);
|
||||||
}
|
}
|
||||||
TotalVo onlineDataAmount = mapper.getOnlineDataAmount(shopId, currentDate);
|
TotalVo onlineDataAmount = mapper.getOnlineDataAmount(shopId, currentDate);
|
||||||
|
if (onlineDataAmount == null) {
|
||||||
|
onlineDataAmount = new TotalVo(currentDate);
|
||||||
|
}
|
||||||
List<TotalVo> statDateRange = mapper.getStatDateRange(shopId, startDate, currentDate);
|
List<TotalVo> statDateRange = mapper.getStatDateRange(shopId, startDate, currentDate);
|
||||||
|
|
||||||
return TotalVo.mergeAndFillData(onlineDataAmount, statDateRange, startDate, currentDate);
|
return TotalVo.mergeAndFillData(onlineDataAmount, statDateRange, startDate, currentDate);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
LEFT JOIN tb_product prod ON tb_shop_prod_statistic.prod_id = prod.id
|
LEFT JOIN tb_product prod ON tb_shop_prod_statistic.prod_id = prod.id
|
||||||
WHERE
|
WHERE
|
||||||
tb_shop_prod_statistic.shop_id = #{shopId}
|
tb_shop_prod_statistic.shop_id = #{shopId}
|
||||||
AND tb_shop_prod_statistic.create_day > #{start}
|
AND tb_shop_prod_statistic.create_day >= #{start}
|
||||||
AND tb_shop_prod_statistic.create_day <= #{end}
|
AND tb_shop_prod_statistic.create_day <= #{end}
|
||||||
<if test="productName != null and productName != ''">
|
<if test="productName != null and productName != ''">
|
||||||
AND prod.name LIKE CONCAT('%',#{productName},'%')
|
AND prod.name LIKE CONCAT('%',#{productName},'%')
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<select id="summaryCountByDay" resultType="com.czg.order.vo.SaleSummaryCountVo">
|
<select id="summaryCountByDay" resultType="com.czg.order.vo.SaleSummaryCountVo">
|
||||||
SELECT
|
SELECT
|
||||||
sum(detail.num-detail.return_num) as saleCount,
|
sum(detail.num-detail.return_num) as saleCount,
|
||||||
sum(detail.pay_amount) as saleAmount,
|
sum(detail.pay_amount) as totalAmount,
|
||||||
sum(detail.refund_num) refundCount,
|
sum(detail.refund_num) refundCount,
|
||||||
sum(detail.return_amount) refundAmount
|
sum(detail.return_amount) refundAmount
|
||||||
FROM
|
FROM
|
||||||
@@ -107,14 +107,14 @@
|
|||||||
<select id="summaryCountDateRange" resultType="com.czg.order.vo.SaleSummaryCountVo">
|
<select id="summaryCountDateRange" resultType="com.czg.order.vo.SaleSummaryCountVo">
|
||||||
SELECT
|
SELECT
|
||||||
sum(tb_shop_prod_statistic.sale_count) AS saleCount,
|
sum(tb_shop_prod_statistic.sale_count) AS saleCount,
|
||||||
sum(tb_shop_prod_statistic.sale_amount) AS saleAmount,
|
sum(tb_shop_prod_statistic.sale_amount) AS totalAmount,
|
||||||
sum(tb_shop_prod_statistic.refund_count) AS refundCount,
|
sum(tb_shop_prod_statistic.refund_count) AS refundCount,
|
||||||
sum(tb_shop_prod_statistic.refund_amount) AS refundAmount
|
sum(tb_shop_prod_statistic.refund_amount) AS refundAmount
|
||||||
FROM
|
FROM
|
||||||
tb_shop_prod_statistic
|
tb_shop_prod_statistic
|
||||||
WHERE
|
WHERE
|
||||||
tb_shop_prod_statistic.shop_id = #{shopId}
|
tb_shop_prod_statistic.shop_id = #{shopId}
|
||||||
AND tb_shop_prod_statistic.create_day > #{start}
|
AND tb_shop_prod_statistic.create_day >= #{start}
|
||||||
AND tb_shop_prod_statistic.create_day <= #{end}
|
AND tb_shop_prod_statistic.create_day <= #{end}
|
||||||
<if test="productName != null and productName != ''">
|
<if test="productName != null and productName != ''">
|
||||||
AND prod.name LIKE CONCAT('%',#{productName},'%')
|
AND prod.name LIKE CONCAT('%',#{productName},'%')
|
||||||
|
|||||||
Reference in New Issue
Block a user