@@ -2,6 +2,7 @@ package com.taskforce.superinvention.app.domain.club
2
2
3
3
import com.querydsl.core.Tuple
4
4
import com.querydsl.core.annotations.QueryProjection
5
+ import com.querydsl.core.types.Predicate
5
6
import com.querydsl.core.types.dsl.BooleanExpression
6
7
import com.querydsl.core.types.dsl.Expressions
7
8
import com.taskforce.superinvention.app.domain.club.QClub.*
@@ -16,6 +17,7 @@ import com.taskforce.superinvention.app.domain.region.QClubRegion.*
16
17
import com.taskforce.superinvention.app.domain.region.QRegion
17
18
import com.taskforce.superinvention.app.domain.region.QRegion.region
18
19
import com.taskforce.superinvention.app.domain.role.QClubUserRole
20
+ import com.taskforce.superinvention.app.domain.role.QRole
19
21
import com.taskforce.superinvention.app.domain.role.QRoleGroup
20
22
import com.taskforce.superinvention.app.domain.role.Role
21
23
import com.taskforce.superinvention.app.domain.user.QUser.user
@@ -45,9 +47,14 @@ class ClubRepositoryImpl: ClubRepositoryCustom, QuerydslRepositorySupport(Club::
45
47
46
48
override fun search (text : String? , regionSeqList : List <Long >, interestSeq : Long? , interestGroupSeq : Long? , pageable : Pageable ): Page <Club > {
47
49
50
+ val clubUserRole = QClubUserRole .clubUserRole
51
+ val role = QRole .role
52
+
48
53
val query = from(club)
49
54
.join(club.clubUser, clubUser).fetchJoin()
50
- .join(clubUser.user, user).fetchJoin()
55
+ .leftJoin(clubUser.user, user).fetchJoin()
56
+ .leftJoin(clubUser.clubUserRoles, clubUserRole).fetchJoin()
57
+ .leftJoin(clubUserRole.role, role).fetchJoin()
51
58
.join(club.clubInterests, clubInterest).fetchJoin()
52
59
.join(clubInterest.interest, interest).fetchJoin()
53
60
.join(interest.interestGroup, interestGroup).fetchJoin()
@@ -57,7 +64,8 @@ class ClubRepositoryImpl: ClubRepositoryCustom, QuerydslRepositorySupport(Club::
57
64
inIfNotEmpty(clubRegion.region, regionSeqList),
58
65
eqIfExist(clubInterest.interest, interestSeq),
59
66
eqIfExist(clubInterest.interest.interestGroup, interestGroupSeq),
60
- searchIfExist(club, text)
67
+ searchIfExist(club, text),
68
+ role.name.`in `(Role .RoleName .CLUB_MEMBER , Role .RoleName .MANAGER , Role .RoleName .MASTER )
61
69
)
62
70
63
71
// PAGING
0 commit comments