首页数据修正,添加外出记录模快

This commit is contained in:
2025-03-21 11:28:09 +08:00
parent 5445f0d3fd
commit 3b2b82e249
14 changed files with 149 additions and 21 deletions

View File

@@ -24,6 +24,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time"/>
<result property="outType" column="out_type"/>
<result property="outMoney" column="out_money"/>
<result property="totalOut" column="total_out"/>
<result property="totalIn" column="total_in"/>
<result property="month" column="month"/>
<result property="receiveAccountId" column="receive_account_id"/>
<result property="receiveAccountName" column="receive_account_name"/>
@@ -173,13 +176,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
</select>
<select id="getPieData" resultMap="SysOaFinanceResult">
select
sum(b.price) as out_money,a.out_type
from sys_oa_finance a
left join sys_oa_detail b on a.finance_id = b.finance_id
where a.finance_type = '0' AND YEAR(a.create_time) = YEAR(NOW()) and a.project_id = '0'
group by a.out_type
<select id="getBarData" resultMap="SysOaFinanceResult">
SELECT
DATE_FORMAT(a.create_time, '%Y-%m') AS month,
SUM(CASE WHEN a.finance_type = '0' THEN b.price ELSE 0 END) AS total_out,
SUM(CASE WHEN a.finance_type = '1' THEN b.price ELSE 0 END) AS total_in
FROM sys_oa_finance a
LEFT JOIN sys_oa_detail b
ON a.finance_id = b.finance_id
AND a.create_time >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 5 MONTH), '%Y-%m-01')
AND DATE_ADD(DATE_FORMAT(NOW(), '%Y-%m-01'), INTERVAL 1 MONTH) > a.create_time
GROUP BY DATE_FORMAT(a.create_time, '%Y-%m')
ORDER BY month;
</select>
<!--项目进出账查询-->