| | |
| | | **/ |
| | | public interface AttendanceRepository extends JpaRepository<Attendance, Long>, JpaSpecificationExecutor<Attendance> { |
| | | |
| | | /** 根据用户和日期查询考勤记录对象 */ |
| | | /** 根据用户和日期查询考勤记录对象 **/ |
| | | @Query(value = "SELECT * from attendance WHERE user_id = ? and attendance_date = ? " , nativeQuery = true) |
| | | Attendance findAllByUserIdAndAttendanceDate(Long userId, String baseDate); |
| | | |
| | | /** 根据员工姓名模糊查询 */ |
| | | /** 根据员工姓名模糊查询 **/ |
| | | @Query(value = "SELECT * from attendance WHERE " , nativeQuery = true) |
| | | List<AttendanceDto> findByUserNameLike(String userName); |
| | | |
| | | /** 根据时间范围查询考勤记录 **/ |
| | | @Query(value = "SELECT * from attendance where user_id = ?1 and attendance_date <= ?3 and attendance_date >= ?2", nativeQuery = true) |
| | | List<Attendance> findAllByUserAndDate(Long userId, String startDate, String endDate); |
| | | |
| | | /** 根据日期查询考勤表 **/ |
| | | @Query(value = "SELECT * FROM attendance a left join sys_user u on u.user_id = a.user_id WHERE a.attendance_date LIKE ? and u.enabled != 0", nativeQuery = true) |
| | | List<Attendance> findAllLikeDate(String baseDate); |
| | | } |