全量提交

This commit is contained in:
2026-02-28 15:20:47 +08:00
parent cb41bcf367
commit 697fe67780
10 changed files with 630 additions and 0 deletions

View File

@@ -215,6 +215,95 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY soti.create_time DESC
</select>
<!-- 绩效报告:按用户 + 时间范围查询任务明细(包含 task_item 子项) -->
<select id="selectPerformanceTaskList" resultMap="SysOaTaskResult">
SELECT sot.task_id,
sot.project_id,
sot.create_user_id,
sot.worker_id,
sot.task_title,
sot.task_type,
sot.task_grade,
sot.collaborator,
sot.finish_time,
sot.temp_time,
sot.begin_time,
sot.origin_finish_time,
sot.postponements,
sot.completed_time,
sot.rank_number,
sot.remark,
sot.task_rank,
sot.state,
sot.time_gap,
sot.status,
sot.accessory,
sot.create_by,
sot.create_time,
sot.update_by,
sot.update_time,
sot.del_flag,
sot.own_rank,
sot.track_id,
stepAgg.tab_node AS tabNode,
stepAgg.first_level_node AS firstLevelNode,
stepAgg.second_level_node AS secondLevelNode,
sop.project_name,
sop.project_num,
sop.project_code,
su1.nick_name AS createUserNickName,
su2.nick_name AS workerNickName,
sd.dept_name AS deptName,
IF(
sot.completed_time IS NULL,
IF(
(
SELECT a.end_time
FROM sys_oa_task_item a
WHERE a.task_id = sot.task_id
AND a.completed_time IS NULL
LIMIT 1
) IS NOT NULL,
DATEDIFF(
NOW(),
(
SELECT a.end_time
FROM sys_oa_task_item a
WHERE a.task_id = sot.task_id
AND a.completed_time IS NULL
LIMIT 1
)
),
DATEDIFF(NOW(), sot.finish_time)
),
0
) AS overDays
FROM sys_oa_task sot
LEFT JOIN sys_user su1 ON su1.user_id = sot.create_user_id
LEFT JOIN sys_user su2 ON su2.user_id = sot.worker_id
LEFT JOIN sys_oa_project sop ON sop.project_id = sot.project_id
LEFT JOIN sys_dept sd ON sd.dept_id = su2.dept_id
LEFT JOIN oa_project_schedule_step stepAgg ON stepAgg.track_id = sot.track_id
WHERE sot.del_flag = '0'
AND (
sot.create_user_id = #{userId}
OR sot.worker_id = #{userId}
OR EXISTS (
SELECT 1 FROM sys_oa_task_user sotu
WHERE sotu.task_id = sot.task_id
AND sotu.user_id = #{userId}
AND sotu.del_flag = 0
)
)
AND (
(COALESCE(sot.begin_time, sot.create_time) &lt;= #{endDate}
AND COALESCE(sot.finish_time, sot.temp_time, sot.completed_time, sot.create_time) &gt;= #{startDate})
OR (sot.create_time BETWEEN #{startDate} AND #{endDate})
OR (sot.completed_time BETWEEN #{startDate} AND #{endDate})
)
ORDER BY sot.create_time DESC
</select>
<select id="getMonthlyData"
parameterType="java.lang.String"
resultType="com.ruoyi.oa.domain.UserMonthlyData">