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

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>
<!--项目进出账查询-->

View File

@@ -96,12 +96,30 @@
</select>
<select id="getProjectDataByMonth" resultType="com.ruoyi.oa.domain.vo.SysOaProjectVo">
select sum(soa.day_length + soa.hour / 8) as labor_cost, color, sop.project_name
from sys_oa_project sop
left join sys_oa_attendance soa on sop.project_id = soa.project_id
where soa.create_time between #{firstDay} and #{lastDay}
and soa.del_flag = '0'
group by sop.project_id
SELECT sop.project_id,
sop.project_name,
sop.color,
COALESCE(SUM(soa.day_length + soa.hour / 9),1) AS labor_cost,
SUM(
CASE
WHEN sof.finance_type = 0 THEN sod.price
ELSE 0
END
) AS total_price
FROM sys_oa_project AS sop
LEFT JOIN sys_oa_attendance AS soa
ON sop.project_id = soa.project_id
AND soa.create_time BETWEEN #{firstDay} AND #{lastDay}
AND soa.del_flag = '0'
LEFT JOIN sys_oa_finance AS sof
ON sop.project_id = sof.project_id
AND sof.create_time BETWEEN #{firstDay} AND #{lastDay}
LEFT JOIN sys_oa_detail AS sod
ON sof.finance_id = sod.finance_id
AND sod.create_time BETWEEN #{firstDay} AND #{lastDay}
GROUP BY sop.project_id,
sop.project_name,
sop.color
</select>
<select id="getProjectDataByMonthAndDate" resultType="com.ruoyi.oa.domain.vo.SysOaProjectVo">