diff --git a/src/main/java/com/tiki/server/timeblock/repository/TimeBlockRepository.java b/src/main/java/com/tiki/server/timeblock/repository/TimeBlockRepository.java index 2d600d72..a4b03525 100644 --- a/src/main/java/com/tiki/server/timeblock/repository/TimeBlockRepository.java +++ b/src/main/java/com/tiki/server/timeblock/repository/TimeBlockRepository.java @@ -10,7 +10,8 @@ public interface TimeBlockRepository extends JpaRepository { @Query(value = "select * from time_block " - + "where team_id = :teamId and accessible_position = :position and to_char(start_date, 'YYYY-MM') = :date " + + "where team_id = :teamId and accessible_position = :position and " + + "(to_char(start_date, 'YYYY-MM') = :date or to_char(end_date, 'YYYY-MM') = :date) " + "order by start_date asc", nativeQuery = true) List findByTeamAndAccessiblePositionAndDate(long teamId, String position, String date); }