Skip to content

Commit

Permalink
⚙️ :: (823) 지원서 필터링 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyoil2 committed Nov 5, 2024
1 parent bcedf17 commit ba03979
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -49,7 +50,7 @@ public class ApplicationPersistenceAdapter implements ApplicationPort {

@Override
public List<ApplicationVO> getAllByConditions(ApplicationFilter filter) {
return queryFactory
JPAQuery<ApplicationEntity> query = queryFactory
.selectFrom(applicationEntity)
.join(applicationEntity.student, studentEntity)
.join(applicationEntity.recruitment, recruitmentEntity)
Expand All @@ -63,12 +64,16 @@ public List<ApplicationVO> 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(
Expand Down

0 comments on commit ba03979

Please sign in to comment.