perf(attendance): 优化考勤对比逻辑以及性能
- 实现批量删除和插入操作,减少数据库交互次数 - 预加载员工打卡记录,避免按排班逐条查询的性能问题 - 添加跨天班次标识字段,简化跨天判断逻辑 - 使用缓存机制计算连续旷工天数,替代逐天查询 - 优化过滤窗口逻辑,提高数据处理效率 - 添加批处理大小限制,防止单次操作数据量过大
This commit is contained in:
@@ -36,12 +36,13 @@
|
||||
<result property="shiftStartTime2" column="shift_start_time2"/>
|
||||
<result property="shiftEndTime2" column="shift_end_time2"/>
|
||||
<result property="workHours" column="work_hours"/>
|
||||
<result property="shiftIsCrossDay" column="shift_is_cross_day"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScheduleWithDetailsVo">
|
||||
SELECT s.schedule_id, s.user_id, s.work_date, s.shift_id, s.shift_name, s.shift_group, s.remark,
|
||||
e.name as employee_name, e.dept as employee_dept, e.job_type as employee_job_type,
|
||||
sh.shift_type, sh.start_time as shift_start_time, sh.end_time as shift_end_time, sh.start_time2 as shift_start_time2, sh.end_time2 as shift_end_time2, sh.work_hours
|
||||
sh.shift_type, sh.start_time as shift_start_time, sh.end_time as shift_end_time, sh.start_time2 as shift_start_time2, sh.end_time2 as shift_end_time2, sh.work_hours, sh.is_cross_day as shift_is_cross_day
|
||||
FROM wms_attendance_schedule s
|
||||
LEFT JOIN wms_employee_info e ON s.user_id = e.info_id AND e.del_flag = 0
|
||||
LEFT JOIN wms_attendance_shift sh ON s.shift_id = sh.shift_id AND sh.del_flag = 0
|
||||
|
||||
Reference in New Issue
Block a user