From 804e4a6fddad550c8577ea96a842510c59df789e Mon Sep 17 00:00:00 2001 From: s-choi Date: Thu, 17 Sep 2026 14:51:11 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20JQPL=E3=81=AE=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E5=90=8D=E3=81=A8=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E5=90=8D?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/AllocationRepository.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/example/demo/app/infra/repository/AllocationRepository.java b/src/main/java/com/example/demo/app/infra/repository/AllocationRepository.java index 56913d8..5dc0ece 100644 --- a/src/main/java/com/example/demo/app/infra/repository/AllocationRepository.java +++ b/src/main/java/com/example/demo/app/infra/repository/AllocationRepository.java @@ -13,19 +13,20 @@ public interface AllocationRepository extends JpaRepository findByCourseEntity_CourseId(Long courseId); - @Query(" SELECT co.course_id, " - + " co.course_name, " - + " ca.category_id, " - + " ca.categpry_name, " - + " a.allocation_ratio " - + " FROM allocation_m a " - + " INNER JOIN course_m co " - + " ON a.course_id = co.course_id " - + " INNER JOIN category_t ca " - + " on a.category_id = ca.category_id " - + " WHERE ca.transaction_type = 0 " - + " ORDER BY a.course_id ASC, " - + " a.category_id ASC ") + @Query(" SELECT new com.example.demo.app.domain.model.CourseInfoModel(" + + "co.courseId, " + + " co.courseName, " + + " ca.categoryId, " + + " ca.categoryName, " + + " a.allocationRatio )" + + " FROM AllocationEntity a" + + " INNER JOIN CourseEntity co " + + " ON a.courseEntity.courseId = co.courseId " + + " INNER JOIN CategoryEntity ca " + + " on a.categoryEntity.categoryId = ca.categoryId " + + " WHERE ca.transactionType = 0 " + + " ORDER BY a.courseEntity.courseId ASC, " + + " a.categoryEntity.categoryId ASC ") List findAllJoinedAllocation(); }