This commit is contained in:
2026-02-05 09:24:29 +08:00
parent 625df4c353
commit 746c5c83da
2 changed files with 7 additions and 10 deletions

View File

@@ -219,15 +219,15 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
" SUM(CASE WHEN pay_type = 'main_scan' THEN 1 ELSE 0 END) as mainScanPayCount," + " SUM(CASE WHEN pay_type = 'main_scan' THEN 1 ELSE 0 END) as mainScanPayCount," +
" SUM(CASE WHEN pay_type = 'credit_pay' THEN 1 ELSE 0 END) as creditPayCount," + " SUM(CASE WHEN pay_type = 'credit_pay' THEN 1 ELSE 0 END) as creditPayCount," +
" " + " " +
" SUM(refund_amount) as refundAmount," + " IFNULL(SUM(refund_amount), 0) as refundAmount," +
" SUM(CASE WHEN refund_type = 'cash' or pay_type = 'cash_pay' THEN refund_amount ELSE 0 END) as cashRefundAmount," + " SUM(CASE WHEN refund_type = 'cash' or pay_type = 'cash_pay' THEN refund_amount ELSE 0 END) as cashRefundAmount," +
" " + " " +
" SUM(new_customer_discount_amount) as newCustomerDiscountAmount," + " IFNULL(SUM(new_customer_discount_amount), 0) as newCustomerDiscountAmount," +
" SUM(discount_act_amount) as fullDiscountAmount," + " IFNULL(SUM(discount_act_amount), 0) as fullDiscountAmount," +
" SUM(product_coupon_discount_amount) + SUM(other_coupon_discount_amount) as couponDiscountAmount," + " IFNULL(SUM(product_coupon_discount_amount), 0) + IFNULL(SUM(other_coupon_discount_amount), 0) as couponDiscountAmount," +
" SUM(points_discount_amount) as pointDiscountAmount," + " IFNULL(SUM(points_discount_amount), 0) as pointDiscountAmount," +
" SUM(vip_discount_amount) as memberDiscountAmount," + " IFNULL(SUM(vip_discount_amount), 0) as memberDiscountAmount," +
" SUM(discount_amount) as orderPriceDiscountAmount ," + " IFNULL(SUM(discount_amount), 0) as orderPriceDiscountAmount ," +
" count(1) as orderCount," + " count(1) as orderCount," +
" sum(CASE WHEN seat_num IS NULL OR seat_num <= 0 THEN 1 ELSE seat_num END) as customerCount " + " sum(CASE WHEN seat_num IS NULL OR seat_num <= 0 THEN 1 ELSE seat_num END) as customerCount " +
"FROM" + "FROM" +

View File

@@ -221,9 +221,6 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
.add(creditPayAmount); .add(creditPayAmount);
result.setPayAmount(totalPayAmount); result.setPayAmount(totalPayAmount);
calculateShopOrderStatistic(result); calculateShopOrderStatistic(result);
calculateProfitInfo(result);
calculateTurnoverRate(result);
calculateAvgPayAmount(result);
return result; return result;
} }