shjung před 2 roky
rodič
revize
c627c69e9a

+ 4 - 4
src/main/java/com/its/op/controller/its/scrs/TbScPstnIxrMngmController.java

@@ -35,12 +35,12 @@ public class TbScPstnIxrMngmController {
         return this.service.findAllList();
     }
 
-    @ApiOperation(value = "소속 교차로 관리 개별조회(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class)
+    @ApiOperation(value = "소속 교차로 관리 개별조회(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
-    public TbScPstnIxrMngmDto findById(@PathVariable("ixrGrop") final TbScPstnIxrMngmKey ixrGrop) {
-        return this.service.findById(ixrGrop);
+    public List<TbScPstnIxrMngmDto> findAllListById(@PathVariable("ixrGrop") final Integer ixrGrop) {
+        return this.service.findAllListById(ixrGrop);
     }
-//
+
 //    @ApiOperation(value = "소속 교차로 관리 정보변경(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class)
 //    @PutMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
 //    public TbScPstnIxrMngmDto updateById(@PathVariable("ixrGrop") final TbScPstnIxrMngmKey ixrGrop, @RequestBody @Valid final TbScPstnIxrMngmDto.TbScPstnIxrMngmUpdReq req) {

+ 4 - 5
src/main/java/com/its/op/controller/its/scrs/TbScSpclDdHmsCntlController.java

@@ -1,7 +1,6 @@
 package com.its.op.controller.its.scrs;
 
 import com.its.op.dto.its.scrs.TbScSpclDdHmsCntlDto;
-import com.its.op.entity.its.scrs.TbScSpclDdHmsCntlKey;
 import com.its.op.service.its.scrs.TbScSpclDdHmsCntlService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -35,12 +34,12 @@ public class TbScSpclDdHmsCntlController {
         return this.service.findAllList();
     }
 
-    @ApiOperation(value = "특수 일 시각 제어 개별조회(TB_SC_SPCL_DD_HMS_CNTL)", response = TbScSpclDdHmsCntlDto.class)
+    @ApiOperation(value = "특수 일 시각 제어 개별조회(TB_SC_SPCL_DD_HMS_CNTL)", response = TbScSpclDdHmsCntlDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
-    public TbScSpclDdHmsCntlDto findById(@PathVariable("ixrGrop") final TbScSpclDdHmsCntlKey ixrGrop) {
-        return this.service.findById(ixrGrop);
+    public List<TbScSpclDdHmsCntlDto> findAllListById(@PathVariable("ixrGrop") final Integer ixrGrop) {
+        return this.service.findAllListById(ixrGrop);
     }
-//
+
 //    @ApiOperation(value = "특수 일 시각 제어 정보변경(TB_SC_SPCL_DD_HMS_CNTL)", response = TbScSpclDdHmsCntlDto.class)
 //    @PutMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
 //    public TbScSpclDdHmsCntlDto updateById(@PathVariable("ixrGrop") final TbScSpclDdHmsCntlKey ixrGrop, @RequestBody @Valid final TbScSpclDdHmsCntlDto.TbScSpclDdHmsCntlUpdReq req) {

+ 4 - 0
src/main/java/com/its/op/dao/repository/its/scrs/TbScPstnIxrMngmRepository.java

@@ -5,6 +5,7 @@ import com.its.op.entity.its.scrs.TbScPstnIxrMngmKey;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -18,4 +19,7 @@ public interface TbScPstnIxrMngmRepository extends JpaRepository<TbScPstnIxrMngm
     @Query("select p from TbScPstnIxrMngm p")
     List<TbScPstnIxrMngm> findAllList();
 
+    @Query("select p from TbScPstnIxrMngm p where p.ixrGrop = :ixrGrop")
+    List<TbScPstnIxrMngm> findAllListById(@Param("ixrGrop") Integer ixrGrop);
+
 }

+ 4 - 0
src/main/java/com/its/op/dao/repository/its/scrs/TbScSpclDdHmsCntlRepository.java

@@ -5,6 +5,7 @@ import com.its.op.entity.its.scrs.TbScSpclDdHmsCntlKey;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -18,4 +19,7 @@ public interface TbScSpclDdHmsCntlRepository extends JpaRepository<TbScSpclDdHms
     @Query("select p from TbScSpclDdHmsCntl p")
     List<TbScSpclDdHmsCntl> findAllList();
 
+    @Query("select p from TbScSpclDdHmsCntl p where p.ixrGrop = :ixrGrop")
+    List<TbScSpclDdHmsCntl> findAllListById(@Param("ixrGrop") Integer ixrGrop);
+
 }

+ 10 - 1
src/main/java/com/its/op/service/its/scrs/TbScPstnIxrMngmService.java

@@ -54,6 +54,16 @@ public class TbScPstnIxrMngmService {
         return result;
     }
 
+    @Transactional(readOnly = true)
+    public List<TbScPstnIxrMngmDto> findAllListById(Integer ixrGrop) {
+        List<TbScPstnIxrMngmDto> result = new ArrayList<>();
+        List<TbScPstnIxrMngm> data = this.repo.findAllListById(ixrGrop);
+        for (TbScPstnIxrMngm entity : data) {
+            result.add(entity.toDto());
+        }
+        return result;
+    }
+
     // 데이터 1건 조회(기존 데이터가 반드시 존재해야 함)
     @Transactional(readOnly = true)
     public TbScPstnIxrMngmDto findById(TbScPstnIxrMngmKey ixrGrop) {
@@ -111,5 +121,4 @@ public class TbScPstnIxrMngmService {
         }
         return result;
     }
-
 }

+ 10 - 0
src/main/java/com/its/op/service/its/scrs/TbScSpclDdHmsCntlService.java

@@ -54,6 +54,16 @@ public class TbScSpclDdHmsCntlService {
         return result;
     }
 
+    @Transactional(readOnly = true)
+    public List<TbScSpclDdHmsCntlDto> findAllListById(Integer ixrGrop) {
+        List<TbScSpclDdHmsCntlDto> result = new ArrayList<>();
+        List<TbScSpclDdHmsCntl> data = this.repo.findAllListById(ixrGrop);
+        for (TbScSpclDdHmsCntl entity : data) {
+            result.add(entity.toDto());
+        }
+        return result;
+    }
+
     // 데이터 1건 조회(기존 데이터가 반드시 존재해야 함)
     @Transactional(readOnly = true)
     public TbScSpclDdHmsCntlDto findById(TbScSpclDdHmsCntlKey ixrGrop) {