From 1f097aff5eebb687794a2549a6ff0713c138e648 Mon Sep 17 00:00:00 2001 From: pkl0912 Date: Thu, 28 Nov 2024 18:07:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B8=B0=EB=A1=9D=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=B6=A9=EB=8F=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/server/poptato/todo/application/TodoService.java | 1 + .../poptato/todo/infra/repository/JpaTodoRepository.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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);