weicd
2023-11-28 fd7ee4d47858ce5a392dfc203ca21fa0aca2fee7
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceBusinessTravelRepository.java
@@ -50,4 +50,8 @@
    // 查询出差记录
    @Query(value = "SELECT * from attendance_business_travel where user_id = ?1 and travel_start_time <= ?3 and travel_end_time >= ?2 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
    List<AttendanceBusinessTravel> findByUserAndSEDate(Long userId, LocalDateTime startDate, LocalDateTime endDate);
    // 查询出差天数
    @Query(value = "SELECT SUM(travel_duration) from attendance_business_travel where user_id = ?1 and travel_start_time >= ?2 and travel_end_time < ?3 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
    Integer findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate);
}