From ba03979463203ce7a086c7ca44297060887268ab Mon Sep 17 00:00:00 2001 From: "tae.y" <0211ilyoil@gmail.com> Date: Tue, 5 Nov 2024 22:44:29 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(823)=20=EC=A7=80?= =?UTF-8?q?=EC=9B=90=EC=84=9C=20=ED=95=84=ED=84=B0=EB=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/ApplicationPersistenceAdapter.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java index 204501b11..eb646111d 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java @@ -1,6 +1,7 @@ package team.retum.jobis.domain.application.persistence; import com.querydsl.core.types.dsl.BooleanExpression; +import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQueryFactory; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; @@ -49,7 +50,7 @@ public class ApplicationPersistenceAdapter implements ApplicationPort { @Override public List getAllByConditions(ApplicationFilter filter) { - return queryFactory + JPAQuery query = queryFactory .selectFrom(applicationEntity) .join(applicationEntity.student, studentEntity) .join(applicationEntity.recruitment, recruitmentEntity) @@ -63,12 +64,16 @@ public List getAllByConditions(ApplicationFilter filter) { eqWinterIntern(filter.getWinterIntern()), eqYear(filter.getYear()) ) - .offset(filter.getOffset()) - .limit(filter.getLimit()) .orderBy( applicationEntity.updatedAt.desc(), applicationEntity.createdAt.desc() - ) + ); + + if (filter.getPage() != null) { + query.offset(filter.getOffset()) + .limit(filter.getLimit()); + } + return query .transform( groupBy(applicationEntity.id) .list(