diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/mapper/ShopOrderStatisticMapper.java b/cash-service/order-service/src/main/java/com/czg/service/order/mapper/ShopOrderStatisticMapper.java index 59e208abe..f24af4c1d 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/mapper/ShopOrderStatisticMapper.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/mapper/ShopOrderStatisticMapper.java @@ -219,15 +219,15 @@ public interface ShopOrderStatisticMapper extends BaseMapper " 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(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(new_customer_discount_amount) as newCustomerDiscountAmount," + - " SUM(discount_act_amount) as fullDiscountAmount," + - " SUM(product_coupon_discount_amount) + SUM(other_coupon_discount_amount) as couponDiscountAmount," + - " SUM(points_discount_amount) as pointDiscountAmount," + - " SUM(vip_discount_amount) as memberDiscountAmount," + - " SUM(discount_amount) as orderPriceDiscountAmount ," + + " IFNULL(SUM(new_customer_discount_amount), 0) as newCustomerDiscountAmount," + + " IFNULL(SUM(discount_act_amount), 0) as fullDiscountAmount," + + " IFNULL(SUM(product_coupon_discount_amount), 0) + IFNULL(SUM(other_coupon_discount_amount), 0) as couponDiscountAmount," + + " IFNULL(SUM(points_discount_amount), 0) as pointDiscountAmount," + + " IFNULL(SUM(vip_discount_amount), 0) as memberDiscountAmount," + + " IFNULL(SUM(discount_amount), 0) as orderPriceDiscountAmount ," + " count(1) as orderCount," + " sum(CASE WHEN seat_num IS NULL OR seat_num <= 0 THEN 1 ELSE seat_num END) as customerCount " + "FROM" + diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/ShopOrderStatisticServiceImpl.java b/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/ShopOrderStatisticServiceImpl.java index 383d946c1..7064b5d09 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/ShopOrderStatisticServiceImpl.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/ShopOrderStatisticServiceImpl.java @@ -221,9 +221,6 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl