Skip to content

Commit

Permalink
๐Ÿ”— :: (#838) ๋ชจ์ง‘์ค‘์ธ ์ƒํƒœ๋งŒ ์ฒดํฌ
Browse files Browse the repository at this point in the history
  • Loading branch information
4mjeo authored Nov 7, 2024
2 parents 76b9284 + 055a346 commit bfb0e88
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,23 @@ public List<Recruitment> getRecent() {

@Override
public RecruitmentExistsResponse existsByCompanyId(Long companyId) {
boolean winterInternExists = recruitmentJpaRepository.existsByCompanyIdAndWinterIntern(companyId, true);
boolean experientialExists = recruitmentJpaRepository.existsByCompanyIdAndWinterIntern(companyId, false);
boolean winterInternExists = queryFactory
.selectOne()
.from(recruitmentEntity)
.where(
recruitmentEntity.company.id.eq(companyId),
recruitmentEntity.winterIntern.isTrue(),
recruitmentEntity.status.eq(RecruitStatus.RECRUITING)
).fetchFirst() != null;

boolean experientialExists = queryFactory
.selectOne()
.from(recruitmentEntity)
.where(
recruitmentEntity.company.id.eq(companyId),
recruitmentEntity.winterIntern.isFalse(),
recruitmentEntity.status.eq(RecruitStatus.RECRUITING)
).fetchFirst() != null;

return new RecruitmentExistsResponse(winterInternExists, experientialExists);
}
Expand Down

0 comments on commit bfb0e88

Please sign in to comment.