This commit is contained in:
zt
2025-03-06 16:22:37 +08:00
parent 4570788d5e
commit c286edf99f
18 changed files with 208 additions and 163 deletions

View File

@ -98,30 +98,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="todayAttendanceList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
SELECT bpra.id,
bpra.entry_time,
wu.user_id,
wu.phone,
wu.score,
wu.avatar_name,
wu.username,
wu.type_of_work,
bpr.recruit_name,
fpt.task_name,
CASE
WHEN wa.leave_mark_id IS NOT NULL THEN '请假'
WHEN wa.late = 1 THEN '迟到'
WHEN wa.early_leave = 1 THEN '早退'
WHEN wa.missed_in = 0 OR wa.missed_out = 0 THEN '出勤'
ELSE '缺勤'
END AS attendance_status
bpra.entry_time,
bpra.user_id,
wu.phone,
wu.score,
wu.avatar_name,
wu.username,
wu.type_of_work,
bpr.recruit_name,
fpt.task_name,
CASE
WHEN wa.leave_mark_id = 1 THEN '请假'
WHEN wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0 THEN '正常'
WHEN wa.late = 1 or wa.early_leave = 1 or wa.missed_in = 1 or wa.missed_out = 1 THEN '异常'
ELSE '异常'
END AS attendance_status
FROM bgt_project_recruit_apply bpra
LEFT JOIN wgz_user wu ON bpra.user_id = wu.user_id
LEFT JOIN wgz_attendance wa ON wa.user_id = wu.user_id AND wa.recruit_id = bpra.recruit_id AND wa.date = #{dto.date}
LEFT JOIN bgt_project_recruit bpr ON bpr.id = bpra.recruit_id
LEFT JOIN fbs_project_task fpt ON fpt.id = bpr.task_id
WHERE bpra.status = '5' and bpra.recruit_id IN (SELECT id
FROM bgt_project_recruit
WHERE task_id = #{dto.taskId})
LEFT JOIN bgt_project_recruit bpr ON bpr.id = bpra.recruit_id
LEFT JOIN fbs_project_task fpt ON fpt.id = bpr.task_id
LEFT JOIN wgz_user wu ON bpra.user_id = wu.user_id
LEFT JOIN wgz_attendance wa ON wa.user_id = wu.user_id AND wa.recruit_id = bpra.recruit_id AND wa.date = #{dto.date}
WHERE bpra.entry_time &lt;= #{dto.date} and ((bpra.leave_time is null and bpra.status = '5')or leave_time>=#{dto.date})
and bpra.recruit_id IN (SELECT id FROM bgt_project_recruit WHERE task_id = #{dto.taskId})
<if test="dto.attendanceType !=null and dto.attendanceType ==1 ">
and (wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0) and leave_mark_id is null
</if>
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
(wa.late = 1 or wa.early_leave = 1 or wa.missed_in = 1 or wa.missed_out = 1) and leave_mark_id is null
</if>
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
and wa.leave_mark_id = 1
</if>
</select>
<select id="underwayPage" resultType="com.ruoyi.wgz.bo.res.WgzAppUnderwayRes">

View File

@ -42,6 +42,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by date order by date
</select>
<select id="countDayByTaskId" resultType="com.ruoyi.bgt.domain.vo.BgtDayAttendanceCountVO">
select count(1) as reportToDutyNum,
date
from wgz_attendance
where date between #{beginDate} and #{endDate}
and (clock_in_time is not null or clock_out_time is not null)
and recruit_id in (select id from bgt_project_recruit where task_id = #{taskId} )
group by date order by date
</select>
<select id="dayTotalNum" resultType="Integer">
select count(1) from bgt_project_recruit_apply where entry_time &lt;= #{date} and ((leave_time is null and status = '5')or leave_time>=#{date})