Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: left join 시 중복 문제 해결 -> 일부 서브 쿼리로 해결 #184

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

hyeonjaez
Copy link
Member

  • 제목 : refactor : gathering 전반적인 쿼리 문 수정 및 home_gathering 좋아요 했는지, 북마크 했는지 데이터 확인

📝작업 내용

gathering 추천 리스트, gathering 페이지네이션, gathering_home 쿼리문 수정

  • gathering applicants 수 leftjoin -> 서브쿼리로 변경

  • gathering like count 서브쿼리로 변경

  • 해당 회원이 좋아요 했는지 서브쿼리로 변경

  • 해당 회원이 북마크 했는지 서브쿼리로 변경

  • home_gathering에서 좋아요 했는지, 북마크 했는지 데이터 확인

Copy link
Contributor

@Astin01 Astin01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다

@@ -51,14 +51,11 @@ public GatheringRepositoryImpl() {

@Override
public List<GatheringBriefResponse> getGatheringRecommend(Long gatheringId, Long gatheringCategoryId, Long userId) {

NumberExpression<Integer> likeCount = countGreatGatheringByGatheringById();
NumberExpression<Integer> applicantsCount = applicantsCountNowConsent();
return from(gathering)
.join(zoneCategoryChild).on(zoneCategoryChild.id.eq(gathering.zoneCategory.id))
.leftJoin(zoneCategoryParent).on(zoneCategoryParent.id.eq(zoneCategoryChild.parentZoneCategory.id))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아직 join시에 fetch join 적용이 안되어 있는데 이부분은 추후에 수정해주시면 좋을 거 같습니다

@hyeonjaez hyeonjaez merged commit 996ba72 into develop Sep 19, 2024
1 check failed
@hyeonjaez hyeonjaez deleted the fix/gathering_page_home branch September 19, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants