获取Key 错误

This commit is contained in:
2025-11-24 15:46:21 +08:00
parent b8f83c649d
commit b48d2c1cb7
3 changed files with 10 additions and 8 deletions

View File

@@ -65,8 +65,7 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
" tb_shop_order_statistic " +
"WHERE " +
" shop_id = #{shopId} " +
" AND statistic_date > #{start} " +
" AND statistic_date <= #{end} ")
" AND statistic_date BETWEEN #{start} AND #{end} ")
ShopOrderStatistic countStatistic(Long shopId, LocalDate start, LocalDate end);
//---------------------------------------------金额统计---------------------------------------------------
/**
@@ -98,7 +97,7 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
" tb_shop_order_statistic " +
" WHERE" +
" shop_id = #{shopId} " +
"and statistic_date > #{start} " +
"and statistic_date >= #{start} " +
"and statistic_date <= #{end} " +
"GROUP BY tradeDay")
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 " +
" FROM tb_shop_order_statistic " +
" WHERE shop_id = #{shopId} " +
" AND statistic_date > #{start} " +
" AND statistic_date >= #{start} " +
" AND statistic_date <= #{end} ")
Map<String, BigDecimal> getPayTypeDateRangeRaw(Long shopId, LocalDate start, LocalDate end);

View File

@@ -67,6 +67,9 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
startDate = currentDate.minusDays(29);
}
TotalVo onlineDataAmount = mapper.getOnlineDataAmount(shopId, currentDate);
if (onlineDataAmount == null) {
onlineDataAmount = new TotalVo(currentDate);
}
List<TotalVo> statDateRange = mapper.getStatDateRange(shopId, startDate, currentDate);
return TotalVo.mergeAndFillData(onlineDataAmount, statDateRange, startDate, currentDate);

View File

@@ -58,7 +58,7 @@
LEFT JOIN tb_product prod ON tb_shop_prod_statistic.prod_id = prod.id
WHERE
tb_shop_prod_statistic.shop_id = #{shopId}
AND tb_shop_prod_statistic.create_day &gt; #{start}
AND tb_shop_prod_statistic.create_day &gt;= #{start}
AND tb_shop_prod_statistic.create_day &lt;= #{end}
<if test="productName != null and productName != ''">
AND prod.name LIKE CONCAT('%',#{productName},'%')
@@ -73,7 +73,7 @@
<select id="summaryCountByDay" resultType="com.czg.order.vo.SaleSummaryCountVo">
SELECT
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.return_amount) refundAmount
FROM
@@ -107,14 +107,14 @@
<select id="summaryCountDateRange" resultType="com.czg.order.vo.SaleSummaryCountVo">
SELECT
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_amount) AS refundAmount
FROM
tb_shop_prod_statistic
WHERE
tb_shop_prod_statistic.shop_id = #{shopId}
AND tb_shop_prod_statistic.create_day &gt; #{start}
AND tb_shop_prod_statistic.create_day &gt;= #{start}
AND tb_shop_prod_statistic.create_day &lt;= #{end}
<if test="productName != null and productName != ''">
AND prod.name LIKE CONCAT('%',#{productName},'%')