diff --git a/pennyway-domain/src/main/java/kr/co/pennyway/domain/domains/spending/repository/SpendingCustomRepositoryImpl.java b/pennyway-domain/src/main/java/kr/co/pennyway/domain/domains/spending/repository/SpendingCustomRepositoryImpl.java index 359ad2f02..1c56e65cf 100644 --- a/pennyway-domain/src/main/java/kr/co/pennyway/domain/domains/spending/repository/SpendingCustomRepositoryImpl.java +++ b/pennyway-domain/src/main/java/kr/co/pennyway/domain/domains/spending/repository/SpendingCustomRepositoryImpl.java @@ -51,10 +51,11 @@ public List findByYearAndMonth(Long userId, int year, int month) { List> orderSpecifiers = QueryDslUtil.getOrderSpecifier(sort); return queryFactory.selectFrom(spending) - .leftJoin(spending.user, user) .leftJoin(spending.spendingCustomCategory, spendingCustomCategory).fetchJoin() .where(spending.spendAt.year().eq(year) - .and(spending.spendAt.month().eq(month))) + .and(spending.spendAt.month().eq(month)) + .and(spending.user.id.eq(userId)) + ) .orderBy(orderSpecifiers.toArray(new OrderSpecifier[0])) .fetch(); }