fix(hrm): 考勤记录支持员工姓名搜索,并全量核对两个模块的所有搜索条件
现象:考勤记录「员工姓名」搜索无效,仍返回全部记录。
根因与考勤统计同一个坑:前端搜索表单有 userName 字段,
但后端 HrmAttendanceRecordPageReqVO 没有该参数,传了被忽略。
修复:
- HrmAttendanceRecordPageReqVO 增加 userName;
- HrmAttendanceRecordMapper 新增 selectPage(reqVO, userIds) 重载,
支持按员工ID集合过滤(hrm_attendance_record.user_id 存的是 hrm_employee.id);
- Service 先按姓名模糊查出员工ID集合,再按集合过滤;查不到人时直接返回空,
避免退化成查全部。
全量核对(mom-zyjc 实测,逐条与数据库核对):
考勤记录 /hrm/attendance/record/page
无筛选 8 = 8 OK
userName=郭琴 5 = 5 OK
userName=兰帅 1 = 1 OK
userName=张 0 = 0 OK(3 个姓张的员工均无打卡记录)
userName=zzz不存在 0 = 0 OK
startDate~endDate 10-26~28 4 = 4 OK
startDate~endDate 11月 2 = 2 OK
deptId=133 6 = 6 OK(郭琴5 + 排孜来提1)
clockInType=2 迟到 7 = 7 OK
clockOutType=4 缺卡 7 = 7 OK
userName+clockOutType 组合 4 = 4 OK
userName+日期 组合 1 = 1 OK
考勤统计 /hrm/attendance/summary/page
无筛选 396 = 396 OK
userName=郭琴 3 = 3 OK
userName+yearMonth 1 = 1 OK
deptId=133 15 = 15 OK(5员工 x 3个月)
yearMonth=2026-10 132 = 132 OK
按日区间 132 = 132 OK
按日区间+userName 1 = 1 OK
前端无需改动(userId/userName/date/deptId/clockInType/clockOutType 均已就绪)。