| | |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
| | | import org.springframework.data.jpa.repository.Query;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
| | | // 查询出差天数
|
| | | @Query(value = "SELECT * 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)
|
| | | List<AttendanceBusinessTravel> findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate);
|
| | |
|
| | | // 查询某天出差总时长
|
| | | @Query(value = "SELECT COALESCE(SUM(travel_duration), 0) FROM attendance_business_travel WHERE user_id = ?2 AND approval_status IN ('business_approve_status_reviewed', 'business_approve_status_agree') AND id != ?3 AND travel_start_time LIKE CONCAT(?1, '%')", nativeQuery = true)
|
| | | BigDecimal countTravelDuration(String date, Long userId, Long id);
|
| | | } |