mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
bugfix 修复保险金额统计错误
This commit is contained in:
@@ -6439,7 +6439,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
vo.setCount(stat.getOrderCount());
|
||||
vo.setOrderCount(stat.getOrderCount());
|
||||
BigDecimal insuranceAmount = stat.getInsuranceAmount() == null ? BigDecimal.ZERO : stat.getInsuranceAmount();
|
||||
vo.setInsuranceAmount(totalInsuranceAmount);
|
||||
vo.setInsuranceAmount(insuranceAmount);
|
||||
|
||||
result.add(vo);
|
||||
|
||||
|
||||
@@ -3581,7 +3581,20 @@
|
||||
SELECT
|
||||
DATE_FORMAT(create_time, '%Y-%m') AS month,
|
||||
COUNT(*) AS orderCount,
|
||||
IFNULL(SUM(insurance_amount), 0) AS insuranceAmount
|
||||
IFNULL(SUM(
|
||||
CASE
|
||||
WHEN insurance_amount > 0
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM order_insurance_info insurance_info
|
||||
WHERE insurance_info.order_code = order_basic_info.order_code
|
||||
AND insurance_info.del_flag = '0'
|
||||
AND insurance_info.refund_status = '1'
|
||||
)
|
||||
THEN insurance_amount
|
||||
ELSE 0
|
||||
END
|
||||
), 0) AS insuranceAmount
|
||||
FROM order_basic_info
|
||||
WHERE create_time <![CDATA[ >= ]]> #{dto.startTime}
|
||||
AND create_time <![CDATA[ < ]]> #{dto.endTime}
|
||||
@@ -3608,6 +3621,13 @@
|
||||
WHERE
|
||||
`del_flag` = '0'
|
||||
AND `insurance_amount` > 0
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM order_insurance_info insurance_info
|
||||
WHERE insurance_info.order_code = order_basic_info.order_code
|
||||
AND insurance_info.del_flag = '0'
|
||||
AND insurance_info.refund_status = '1'
|
||||
)
|
||||
and `settlement_time` BETWEEN #{dto.startTime,jdbcType=VARCHAR} and #{dto.endTime,jdbcType=VARCHAR}
|
||||
group by DATE_FORMAT(settlement_time, '%Y-%m-%d');
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user