This commit is contained in:
YAS\29473
2025-11-13 14:25:11 +08:00
parent 88b14f5b69
commit 38fde97b7b
3 changed files with 75 additions and 79 deletions

View File

@@ -3451,4 +3451,21 @@
AND DATE_ADD(#{endTime,jdbcType=VARCHAR}, INTERVAL 1 DAY)
ORDER BY t1.create_time DESC
</select>
<select id="selectOrderCountAndInsuranceByMonth"
parameterType="com.jsowell.pile.dto.QueryOrderDTO"
resultType="com.jsowell.pile.vo.web.OrderMonthStatVO">
SELECT
DATE_FORMAT(create_time, '%Y-%m') AS month,
COUNT(*) AS orderCount,
IFNULL(SUM(insurance_amount), 0) AS insuranceAmount
FROM order_basic_info
WHERE create_time <![CDATA[ >= ]]> #{dto.startTime}
AND create_time <![CDATA[ < ]]> #{dto.endTime}
GROUP BY DATE_FORMAT(create_time, '%Y-%m')
ORDER BY month ASC
</select>
</mapper>