新增管理端账户消费趋势统计接口、生产端账户总额数据接口

This commit is contained in:
gaoqr
2025-09-01 17:52:22 +08:00
parent 2250b1b9b4
commit 6fe28468cf
10 changed files with 487 additions and 35 deletions
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.organamount.OrganAmountMapper">
<sql id="dateFormat">
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@QUARTER.getValue()">
,CONCAT(YEAR(create_time), '-', QUARTER(create_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@MONTH.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', WEEK(create_time, 1)) AS date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', DAY(create_time)) as date
</if>
</sql>
<select id="selectOrganIncomeExpenseTrendGroupByCreateTime"
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO">
select sum(cash_amount_change) as amount
<include refid="dateFormat"/>
from income_expense_details
where organ_id = #{organId}
and create_time between #{req.createTime[0]} and #{req.createTime[1]}
GROUP BY date
</select>
</mapper>