diff --git a/src/main/java/server/poptato/todo/application/TodoService.java b/src/main/java/server/poptato/todo/application/TodoService.java index 2078b25..e83f1d7 100644 --- a/src/main/java/server/poptato/todo/application/TodoService.java +++ b/src/main/java/server/poptato/todo/application/TodoService.java @@ -36,6 +36,7 @@ import java.util.List; import java.util.Optional; +import static org.hibernate.query.sqm.tree.SqmNode.log; import static server.poptato.category.exception.errorcode.CategoryExceptionErrorCode.CATEGORY_NOT_EXIST; import static server.poptato.emoji.exception.errorcode.EmojiExceptionErrorCode.EMOJI_NOT_EXIST; import static server.poptato.todo.exception.errorcode.TodoExceptionErrorCode.COMPLETED_DATETIME_NOT_EXIST; diff --git a/src/main/java/server/poptato/todo/infra/repository/JpaTodoRepository.java b/src/main/java/server/poptato/todo/infra/repository/JpaTodoRepository.java index 8feaa4f..920c52b 100644 --- a/src/main/java/server/poptato/todo/infra/repository/JpaTodoRepository.java +++ b/src/main/java/server/poptato/todo/infra/repository/JpaTodoRepository.java @@ -74,7 +74,10 @@ List findCompletedTodayByUserIdOrderByCompletedDateTimeAsc( " SELECT c.todoId FROM CompletedDateTime c " + " WHERE DATE(c.dateTime) = :localDate" + ") AND t.userId = :userId " + - "ORDER BY (SELECT c.dateTime FROM CompletedDateTime c WHERE c.todoId = t.id) ASC") + "ORDER BY (" + + " SELECT c.dateTime FROM CompletedDateTime c " + + " WHERE c.todoId = t.id AND DATE(c.dateTime) = :localDate" + + ") ASC") Page findTodosByUserIdAndCompletedDateTime(@Param("userId") Long userId, @Param("localDate") LocalDate localDate, Pageable pageable);