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