yaozc
2024-05-30 86b0362eaf4c320dc6a54fc12ce80b0bf7890a85
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceLeaveRepository.java
@@ -53,4 +53,7 @@
    //查询请假记录(根据请假类型)
    @Query(value = "SELECT * from attendance_leave where user_id = ?1 and leave_start_time < ?3 and leave_end_time > ?2 and approval_status IN  ('approval_status_passed') and leave_type = ?4", nativeQuery = true)
    List<AttendanceLeave> findByUserIdAndDateAndLeaveType(Long userId, LocalDateTime startDate, LocalDateTime endDate,String LeaveType);
    @Query(value = "SELECT SUM(leave_duration) from attendance_leave where user_id = ?1 and approval_status IN  ('approval_status_passed') and leave_type = ?2", nativeQuery = true)
    Double sumLeaveDurationByUserIdAndLeaveType(Long userId, String LeaveType);
}