| | |
| | | package me.zhengjie.modules.attendance.repository; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | |
| | | @Query(value = "SELECT * FROM attendance_go_out WHERE user_id = ?3 AND approval_status IN ('go_out_approve_status_reviewed', 'go_out_approve_status_agree') AND id NOT IN ?4 AND ((out_start_time >= ?1 and out_start_time <= ?2) OR \n" + |
| | | "(out_start_time <= ?1 and out_end_time >= ?2) OR (out_end_time >= ?1 and out_end_time <= ?2) OR (out_start_time >= ?1 and out_end_time <= ?2))", nativeQuery = true) |
| | | List<AttendanceGoOut> checkCreateUpdateTime(String startTime, String endTime, Long userId, Set<Long> ids); |
| | | |
| | | // 查询外出记录 |
| | | @Query(value = "SELECT * FROM attendance_go_out WHERE user_id = ?1 AND out_start_time <= ?3 AND out_end_time >= ?2 AND approval_status IN ('go_out_approve_status_agree')", nativeQuery = true) |
| | | List<AttendanceGoOut> findByUserAndDate(Long userId, LocalDateTime startDate, LocalDateTime endDate); |
| | | } |