From d3c1aef24e14b863891398cb6eb90d4f6fdf689f Mon Sep 17 00:00:00 2001 From: Dongseok Shin <70707629+shindong96@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:53:53 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A7=88=EA=B0=90=EC=9E=84=EB=B0=95?= =?UTF-8?q?=EC=88=9C=EC=97=90=20=EC=A0=84=ED=98=95=EC=9D=BC=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=20=EA=B0=80=EC=9E=A5=20=ED=9B=84=EC=88=9C?= =?UTF-8?q?=EC=9C=84=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20(#217)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/ApplicationRepositoryCustomImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/out-adapter-persistence-jpa/src/main/java/gohigher/application/entity/ApplicationRepositoryCustomImpl.java b/out-adapter-persistence-jpa/src/main/java/gohigher/application/entity/ApplicationRepositoryCustomImpl.java index 24c7c14c..e71901da 100644 --- a/out-adapter-persistence-jpa/src/main/java/gohigher/application/entity/ApplicationRepositoryCustomImpl.java +++ b/out-adapter-persistence-jpa/src/main/java/gohigher/application/entity/ApplicationRepositoryCustomImpl.java @@ -122,9 +122,13 @@ private NumberExpression sortByProcessType() { private OrderSpecifier[] sortByEndDate(LocalDateTime today) { // 마감이 지나지 않은 경우 (schedule이 today 이후) + long order = 0L; NumberExpression notExpiredCase = new CaseBuilder() - .when(applicationProcessJpaEntity.schedule.after(today)).then(0L) - .otherwise(1L); + .when(applicationProcessJpaEntity.schedule.eq(today)).then(order++) + .when(applicationProcessJpaEntity.schedule.after(today)).then(order++) + .when(applicationProcessJpaEntity.schedule.before(today)).then(order++) + .when(applicationProcessJpaEntity.schedule.isNull()).then(order++) + .otherwise(order); // 마감이 임박한 순서로 정렬 (notExpiredCase 오름차순, schedule 오름차순) OrderSpecifier notExpiredOrder = notExpiredCase.asc();