From 5ce05a0fddf6cd20cfbddd87cae32954abc05f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=20=EC=8A=B9=20=EC=97=B0?= <53565255+seungyeonnnnnni@users.noreply.github.com> Date: Sun, 10 Dec 2023 14:35:33 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix=20:=20=EB=B0=98=EB=B3=B5=EB=AF=B8?= =?UTF-8?q?=EC=85=98=20=EB=A7=88=EA=B0=90=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(=20missionState=20=EC=82=AD=EC=A0=9C=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=82=AD=EC=A0=9C=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/MissionStateScheduleUseCase.java | 26 +------------------ .../MissionStateCustomRepositoryImpl.java | 13 +++++++++- .../service/TeamScoreLogicUseCase.java | 1 - .../teamScore/domain/entity/TeamScore.java | 3 ++- ...issionArchiveCustomRepositoryImplTest.java | 1 + 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateScheduleUseCase.java b/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateScheduleUseCase.java index 09d728ab..5e5fe463 100644 --- a/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateScheduleUseCase.java +++ b/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateScheduleUseCase.java @@ -50,32 +50,9 @@ public void sundayRepeatMissionRoutine() { for (Long id : ongoingRepeatMissions) { teamScoreLogicUseCase.updateTeamScore(id); } - // 미션 state 에서 지우기 ( 이것도 대용량 ) - missionStateReset(ongoingRepeatMissions); - } - - public void missionStateReset(List missionIds) { - List missionStates = missionStateQueryService.findByMissionId(missionIds); - missionStateDeleteService.deleteMissionState(missionStates); } -// /** -// * 단일 미션 마감 -// * 미션 단위 마감 -// * 한시간 마다 실행 -// */ -// public void singleMissionEndRoutineByMission() { -// -// Mission mission = new Mission(); -// LocalDateTime now = LocalDateTime.now(); -// -// if (mission.getDueTo().isAfter(now)) { -// mission.updateStatus(MissionStatus.END); -// teamScoreLogicUseCase.updateTeamScore(mission.getId()); -// } -// } - /** * 단일 미션 마감 * 해당 시간 미션 마감 @@ -94,7 +71,6 @@ public void singleMissionEndRoutine() { } - /** * 미션 시작 * 월요일 아침 @@ -102,7 +78,7 @@ public void singleMissionEndRoutine() { @Scheduled(cron = "0 0 0 * * MON") public void RepeatMissionStart() { List startMission = missionQueryService.findMissionByStatus(MissionStatus.WAIT); - startMission.stream().forEach( + startMission.forEach( mission -> mission.updateStatus(MissionStatus.ONGOING) ); } diff --git a/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java b/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java index a8aebddd..9e9c0c07 100644 --- a/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java +++ b/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java @@ -10,7 +10,10 @@ import javax.persistence.EntityManager; +import java.time.DayOfWeek; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.temporal.TemporalAdjusters; import java.util.List; import java.util.Optional; @@ -27,11 +30,19 @@ public MissionStateCustomRepositoryImpl(EntityManager entityManager) { @Override public int getCountsByMissionId(Long missionId) { + + LocalDate now = LocalDate.now(); + DayOfWeek firstDayOfWeek = DayOfWeek.MONDAY; // 한 주의 시작일을 월요일로 설정 + LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(firstDayOfWeek)); + LocalDate endOfWeek = startOfWeek.plusDays(6); // 한 주의 마지막일을 일요일로 설정 + return queryFactory .select(missionState) .from(missionState) .where( - missionState.mission.id.eq(missionId)) + missionState.mission.id.eq(missionId), + missionState.createdDate.goe(startOfWeek.atStartOfDay()), + missionState.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1))) .fetch().size(); } diff --git a/src/main/java/com/moing/backend/domain/teamScore/application/service/TeamScoreLogicUseCase.java b/src/main/java/com/moing/backend/domain/teamScore/application/service/TeamScoreLogicUseCase.java index 5ffadc2b..02fa9c9a 100644 --- a/src/main/java/com/moing/backend/domain/teamScore/application/service/TeamScoreLogicUseCase.java +++ b/src/main/java/com/moing/backend/domain/teamScore/application/service/TeamScoreLogicUseCase.java @@ -46,7 +46,6 @@ public Long updateTeamScore(Long missionId) { teamScore.updateScore(getScoreByMission(mission)); teamScore.levelUp(); - team.updateLevelOfFire(); teamScoreSaveService.save(teamScore); teamSaveService.saveTeam(team); diff --git a/src/main/java/com/moing/backend/domain/teamScore/domain/entity/TeamScore.java b/src/main/java/com/moing/backend/domain/teamScore/domain/entity/TeamScore.java index efa1b47b..2b19759f 100644 --- a/src/main/java/com/moing/backend/domain/teamScore/domain/entity/TeamScore.java +++ b/src/main/java/com/moing/backend/domain/teamScore/domain/entity/TeamScore.java @@ -42,9 +42,10 @@ public void levelUp() { for (int i = 5; i > 0; i--) { if (steps[i-1] <= this.level && this.level <= steps[i]) { - if (20 + ((i-1) * 15) <= score) { + if ((20 + ((i-1) * 15)) <= score) { this.level+=1; this.score -= (20 + ((i-1) * 15)); + this.team.updateLevelOfFire(); return; } } diff --git a/src/test/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImplTest.java b/src/test/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImplTest.java index 37889c66..5b9db754 100644 --- a/src/test/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImplTest.java +++ b/src/test/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImplTest.java @@ -12,6 +12,7 @@ //import static com.moing.backend.domain.mission.domain.entity.QMission.mission; //import static com.moing.backend.domain.missionState.domain.entity.QMissionState.missionState; //@SpringBootTest +// //class MissionArchiveCustomRepositoryImplTest { // // @Autowired From 158420d64b8df88f23c2012cd122907584b518bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=20=EC=8A=B9=20=EC=97=B0?= <53565255+seungyeonnnnnni@users.noreply.github.com> Date: Sun, 10 Dec 2023 16:34:23 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix=20:=20=EB=B0=98=EB=B3=B5=EB=AF=B8?= =?UTF-8?q?=EC=85=98=20=EB=A7=88=EA=B0=90=20=EB=A1=9C=EC=A7=81=20=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4=20missionArchive=20->=20missionState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MissionArchiveCustomRepositoryImpl.java | 113 +++++++++++++++--- .../service/MissionStateUseCase.java | 18 --- .../MissionStateCustomRepositoryImpl.java | 17 ++- 3 files changed, 107 insertions(+), 41 deletions(-) diff --git a/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java b/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java index d13ae3db..6c764172 100644 --- a/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java +++ b/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java @@ -15,6 +15,7 @@ import com.querydsl.core.types.Order; import com.querydsl.core.types.OrderSpecifier; import com.querydsl.core.types.Projections; +import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.Expressions; import com.querydsl.jpa.JPAExpressions; import com.querydsl.jpa.impl.JPAQueryFactory; @@ -24,7 +25,10 @@ import javax.persistence.EntityManager; import javax.swing.text.html.Option; +import java.time.DayOfWeek; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.temporal.TemporalAdjusters; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -117,13 +121,20 @@ private OrderSpecifier[] createOrderSpecifier(OrderCondition orderCondition) { @Override public Optional> findOneMyArchives(Long memberId,Long missionId,Long count) { + + BooleanExpression repeatTypeCondition = createRepeatTypeConditionByArchive(); + BooleanExpression baseCondition = missionArchive.mission.id.eq(missionId); + BooleanExpression finalCondition = baseCondition.and(repeatTypeCondition); + return Optional.ofNullable(queryFactory .select(missionArchive) .from(missionArchive) .where( - missionArchive.mission.id.eq(missionId), + finalCondition, missionArchive.member.memberId.eq(memberId), missionArchive.count.eq(count) + + ) .orderBy(missionArchive.createdDate.desc()) .fetch() @@ -134,11 +145,16 @@ public Optional> findOneMyArchives(Long memberId,Long missi @Override public Optional> findMyArchives(Long memberId,Long missionId) { + + BooleanExpression repeatTypeCondition = createRepeatTypeConditionByArchive(); + BooleanExpression baseCondition = missionArchive.mission.id.eq(missionId); + BooleanExpression finalCondition = baseCondition.and(repeatTypeCondition); + return Optional.ofNullable(queryFactory .select(missionArchive) .from(missionArchive) .where( - missionArchive.mission.id.eq(missionId), + finalCondition, missionArchive.member.memberId.eq(memberId) ) .orderBy(missionArchive.createdDate.desc()) @@ -151,11 +167,16 @@ public Optional> findMyArchives(Long memberId,Long missionI @Override public Optional> findOthersArchives(Long memberId, Long missionId) { + + BooleanExpression repeatTypeCondition = createRepeatTypeConditionByArchive(); + BooleanExpression baseCondition = missionArchive.mission.id.eq(missionId); + BooleanExpression finalCondition = baseCondition.and(repeatTypeCondition); + return Optional.ofNullable(queryFactory .select(missionArchive) .from(missionArchive) .where( - missionArchive.mission.id.eq(missionId), + finalCondition, missionArchive.member.memberId.ne(memberId), missionArchive.status.eq(MissionArchiveStatus.COMPLETE).or(missionArchive.status.eq(MissionArchiveStatus.SKIP)) ) @@ -167,13 +188,19 @@ public Optional> findOthersArchives(Long memberId, Long mis @Override public Optional findDonePeopleByMissionId(Long missionId) { + + BooleanExpression repeatTypeCondition = createRepeatTypeCondition(); + BooleanExpression baseCondition = missionState.mission.id.eq(missionId); + BooleanExpression finalCondition = baseCondition.and(repeatTypeCondition); + return Optional.of(queryFactory - .select(missionArchive) - .from(missionArchive) + .select(missionState) + .from(missionState) .where( - missionArchive.mission.id.eq(missionId) + finalCondition ) - .groupBy(missionArchive.member) + .groupBy(missionState.member,missionState.mission.number) + .having(missionState.count().goe(missionState.mission.number)) .fetchCount() ); @@ -181,12 +208,18 @@ public Optional findDonePeopleByMissionId(Long missionId) { @Override public Optional findMyDoneCountByMissionId(Long missionId, Long memberId) { + + + BooleanExpression repeatTypeCondition = createRepeatTypeCondition(); + BooleanExpression baseCondition = missionState.mission.id.eq(missionId); + BooleanExpression finalCondition = baseCondition.and(repeatTypeCondition); + return Optional.ofNullable(queryFactory - .select(missionArchive.count()) - .from(missionArchive) + .select(missionState.count()) + .from(missionState) .where( - missionArchive.mission.id.eq(missionId), - missionArchive.member.memberId.eq(memberId) + finalCondition, + missionState.member.memberId.eq(memberId) ) .fetchFirst() ); @@ -195,6 +228,11 @@ public Optional findMyDoneCountByMissionId(Long missionId, Long memberId) @Override public Optional> findRepeatMissionArchivesByMemberId(Long memberId, Long teamId, MissionStatus status) { + + + BooleanExpression repeatTypeCondition = createRepeatTypeCondition(); + + return Optional.ofNullable(queryFactory .select(Projections.constructor(RepeatMissionBoardRes.class, mission.id, @@ -213,10 +251,12 @@ public Optional> findRepeatMissionArchivesByMemberId .where( mission.team.teamId.eq(teamId), mission.type.eq(MissionType.REPEAT), - mission.status.eq(MissionStatus.ONGOING).or(mission.status.eq(MissionStatus.WAIT)) + mission.status.eq(MissionStatus.ONGOING).or(mission.status.eq(MissionStatus.WAIT)), + repeatTypeCondition + ) .groupBy(mission.id,mission.number) - .having(missionState.count().lt(mission.number)) // HAVING 절을 사용하여 조건 적용 +// .having(missionState.count().lt(mission.number)) // HAVING 절을 사용하여 조건 적용 .orderBy(missionState.count().desc()) .fetch()); @@ -230,19 +270,22 @@ public Optional> findFinishMissionsByStatus(Long mem Expression type = Expressions.stringTemplate(String.valueOf(mission.type)); + BooleanExpression repeatTypeCondition = createRepeatTypeCondition(); + return Optional.ofNullable(queryFactory .selectDistinct(Projections.constructor(FinishMissionBoardRes.class, mission.id, mission.dueTo.stringValue(), mission.title, - missionArchive.status.stringValue().coalesce("FAIL").as("status"), + missionState.status.stringValue().coalesce("FAIL").as("status"), mission.type.stringValue(), mission.way.stringValue() )) .from(mission) .leftJoin(mission.missionArchiveList,missionArchive) - .on(missionArchive.member.memberId.eq(memberId)) + .on(missionState.member.memberId.eq(memberId)) .where( + repeatTypeCondition, mission.team.teamId.eq(teamId), mission.status.eq(MissionStatus.SUCCESS).or(mission.status.eq(MissionStatus.END)) ) @@ -293,11 +336,11 @@ public Boolean findMyArchivesToday(Long memberId, Long missionId) { LocalDateTime endOfToday = today.withHour(23).withMinute(59).withSecond(59).withNano(999999999); long count = queryFactory - .selectFrom(missionArchive) + .selectFrom(missionState) .where( - missionArchive.member.memberId.eq(memberId), - missionArchive.mission.id.eq(missionId), - missionArchive.lastModifiedDate.between(startOfToday, endOfToday) // createdDate와 오늘의 시작과 끝을 비교 + missionState.member.memberId.eq(memberId), + missionState.mission.id.eq(missionId), + missionState.lastModifiedDate.between(startOfToday, endOfToday) // createdDate와 오늘의 시작과 끝을 비교 ) .fetchCount(); @@ -325,6 +368,38 @@ public Optional> findPeopleRemainMission() { // ).fetch()); } + // 날짜 조건 생성 메서드 + private BooleanExpression createRepeatTypeCondition() { + LocalDate now = LocalDate.now(); + DayOfWeek firstDayOfWeek = DayOfWeek.MONDAY; + LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(firstDayOfWeek)); + LocalDate endOfWeek = startOfWeek.plusDays(6); + + // MissionType.REPEAT 인 경우의 추가적인 날짜 범위 조건 + BooleanExpression isRepeatType = missionState.mission.type.eq(MissionType.REPEAT); + BooleanExpression dateInRange = missionState.createdDate.goe(startOfWeek.atStartOfDay()) + .and(missionState.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1))); + + // 조건이 MissionType.REPEAT 인 경우에만 날짜 범위 조건 적용 + return isRepeatType.and(dateInRange); + } + + // 날짜 조건 생성 메서드 + private BooleanExpression createRepeatTypeConditionByArchive() { + LocalDate now = LocalDate.now(); + DayOfWeek firstDayOfWeek = DayOfWeek.MONDAY; + LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(firstDayOfWeek)); + LocalDate endOfWeek = startOfWeek.plusDays(6); + + // MissionType.REPEAT 인 경우의 추가적인 날짜 범위 조건 + BooleanExpression isRepeatType = missionArchive.mission.type.eq(MissionType.REPEAT); + BooleanExpression dateInRange = missionArchive.createdDate.goe(startOfWeek.atStartOfDay()) + .and(missionArchive.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1))); + + // 조건이 MissionType.REPEAT 인 경우에만 날짜 범위 조건 적용 + return isRepeatType.and(dateInRange); + } + } diff --git a/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateUseCase.java b/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateUseCase.java index 43e90c1e..55c0ddfc 100644 --- a/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateUseCase.java +++ b/src/main/java/com/moing/backend/domain/missionState/application/service/MissionStateUseCase.java @@ -79,25 +79,7 @@ public void updateMissionState(Member member, Mission mission, MissionArchive mi teamScoreLogicUseCase.updateTeamScore(mission.getId()); } - - } - - public void deleteMissionState(Member member, Mission mission, MissionArchive missionArchive) { - - MissionState missionState = missionStateQueryService.findMissionState(member, mission); - missionStateDeleteService.deleteMissionState(missionState); - } - public void missionStateReset(List missionIds) { - List missionStates = missionStateQueryService.findByMissionId(missionIds); - missionStateDeleteService.deleteMissionState(missionStates); - } - - public void deleteAllMissionState(Long missionId) { - missionStateDeleteService.deleteMissionStateByMission(missionId); - } - - } diff --git a/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java b/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java index 9e9c0c07..10b9e4b4 100644 --- a/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java +++ b/src/main/java/com/moing/backend/domain/missionState/domain/repository/MissionStateCustomRepositoryImpl.java @@ -3,8 +3,10 @@ import com.moing.backend.domain.member.domain.entity.Member; import com.moing.backend.domain.mission.domain.entity.Mission; import com.moing.backend.domain.mission.domain.entity.constant.MissionStatus; +import com.moing.backend.domain.mission.domain.entity.constant.MissionType; import com.moing.backend.domain.missionArchive.domain.entity.MissionArchiveStatus; import com.moing.backend.domain.missionState.domain.entity.MissionState; +import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.jpa.impl.JPAQueryFactory; import javax.persistence.EntityManager; @@ -36,13 +38,20 @@ public int getCountsByMissionId(Long missionId) { LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(firstDayOfWeek)); LocalDate endOfWeek = startOfWeek.plusDays(6); // 한 주의 마지막일을 일요일로 설정 + BooleanExpression repeatTypeCondition = missionState.mission.type.eq(MissionType.REPEAT) + .and(missionState.createdDate.goe(startOfWeek.atStartOfDay())) + .and(missionState.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1))); + + // 기본 조건 + BooleanExpression baseCondition = missionState.mission.id.eq(missionId); + // 조건 적용 + BooleanExpression finalCondition = baseCondition.and(repeatTypeCondition); + + return queryFactory .select(missionState) .from(missionState) - .where( - missionState.mission.id.eq(missionId), - missionState.createdDate.goe(startOfWeek.atStartOfDay()), - missionState.createdDate.loe(endOfWeek.atStartOfDay().plusDays(1).minusNanos(1))) + .where(finalCondition) .fetch().size(); } From 568b4900b7ae65f74cd923d81e84ac2e79f56674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=20=EC=8A=B9=20=EC=97=B0?= <53565255+seungyeonnnnnni@users.noreply.github.com> Date: Sun, 10 Dec 2023 16:43:43 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix=20:=20=ED=83=88=ED=87=B4=ED=95=9C=20?= =?UTF-8?q?=EC=86=8C=EB=AA=A8=EC=9E=84=EC=9B=90=20=EB=B6=88=EB=8D=98?= =?UTF-8?q?=EC=A7=80=EA=B8=B0=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fire/domain/repository/FireCustomRepositoryImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/moing/backend/domain/fire/domain/repository/FireCustomRepositoryImpl.java b/src/main/java/com/moing/backend/domain/fire/domain/repository/FireCustomRepositoryImpl.java index 9b51a0a0..b865a2a9 100644 --- a/src/main/java/com/moing/backend/domain/fire/domain/repository/FireCustomRepositoryImpl.java +++ b/src/main/java/com/moing/backend/domain/fire/domain/repository/FireCustomRepositoryImpl.java @@ -92,7 +92,8 @@ public Optional> getFireReceivers(Long teamId, Long mission .where( teamMember.team.teamId.eq(teamId), teamMember.member.memberId.ne(memberId), - teamMember.member.memberId.notIn(missionDonePeople) + teamMember.member.memberId.notIn(missionDonePeople), + teamMember.member.isDeleted.ne(Boolean.TRUE) ) .fetch()); From 3c5861449aff9910c67d6e251b391f10514b439a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=20=EC=8A=B9=20=EC=97=B0?= <53565255+seungyeonnnnnni@users.noreply.github.com> Date: Sun, 10 Dec 2023 16:46:50 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix=20:=20=EC=A7=84=ED=96=89=EC=A4=91?= =?UTF-8?q?=EB=AF=B8=EC=85=98=20=EB=B3=B4=EB=93=9C=20=EB=B0=98=EB=B3=B5?= =?UTF-8?q?=EB=AF=B8=EC=85=98=20=EA=B4=80=EB=A0=A8=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?->=20=EC=9D=B8=EC=A6=9D=20=EC=99=84=EB=A3=8C=ED=95=9C=20?= =?UTF-8?q?=EB=AF=B8=EC=85=98=20=EB=9C=A8=EC=A7=80=20=EC=95=8A=EA=B2=8C,?= =?UTF-8?q?=20=EC=A7=84=ED=96=89=20=EC=98=88=EC=A0=95=20=EB=AF=B8=EC=85=98?= =?UTF-8?q?=20=EB=9C=A8=EC=A7=80=20=EC=95=8A=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/repository/MissionArchiveCustomRepositoryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java b/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java index 6c764172..72efacde 100644 --- a/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java +++ b/src/main/java/com/moing/backend/domain/missionArchive/domain/repository/MissionArchiveCustomRepositoryImpl.java @@ -251,12 +251,12 @@ public Optional> findRepeatMissionArchivesByMemberId .where( mission.team.teamId.eq(teamId), mission.type.eq(MissionType.REPEAT), - mission.status.eq(MissionStatus.ONGOING).or(mission.status.eq(MissionStatus.WAIT)), + mission.status.eq(MissionStatus.ONGOING), repeatTypeCondition ) .groupBy(mission.id,mission.number) -// .having(missionState.count().lt(mission.number)) // HAVING 절을 사용하여 조건 적용 + .having(missionState.count().lt(mission.number)) // HAVING 절을 사용하여 조건 적용 .orderBy(missionState.count().desc()) .fetch());