This commit is contained in:
Guoqs
2025-11-13 16:15:54 +08:00
9 changed files with 160 additions and 16 deletions

View File

@@ -3457,4 +3457,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>