shjung 2 gadi atpakaļ
vecāks
revīzija
92e6d3ec76

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

@@ -1,7 +1,6 @@
 package com.its.op.controller.its.scrs;
 
 import com.its.op.dto.its.scrs.TbScIxrPhasDto;
-import com.its.op.entity.its.scrs.TbScIxrPhasKey;
 import com.its.op.service.its.scrs.TbScIxrPhasService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -35,10 +34,10 @@ public class TbScIxrPhasController {
         return this.service.findAllList();
     }
 
-    @ApiOperation(value = "교차로 현시 개별조회(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class)
+    @ApiOperation(value = "교차로 현시 개별조회(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
-    public TbScIxrPhasDto findById(@PathVariable("sgnlIxrNmbr") final TbScIxrPhasKey sgnlIxrNmbr) {
-        return this.service.findById(sgnlIxrNmbr);
+    public List<TbScIxrPhasDto> findListById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr) {
+        return this.service.findListById(sgnlIxrNmbr);
     }
 //
 //    @ApiOperation(value = "교차로 현시 정보변경(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class)

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

@@ -35,10 +35,11 @@ public class TbScTodCnfgController {
         return this.service.findAllList();
     }
 
-    @ApiOperation(value = "TOD 구성 개별조회(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class)
-    @GetMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
-    public TbScTodCnfgDto findById(@PathVariable("sgnlIxrNmbr") final TbScTodCnfgKey sgnlIxrNmbr) {
-        return this.service.findById(sgnlIxrNmbr);
+    @ApiOperation(value = "TOD 구성 개별조회(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class, responseContainer = "ArrayList")
+    @GetMapping(value = "/{sgnlIxrNmbr}/{ixrOperMode}", produces = {"application/json; charset=utf8"})
+    public List<TbScTodCnfgDto> findById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr,
+                                   @PathVariable("ixrOperMode") final Integer ixrOperMode) {
+        return this.service.findListById(sgnlIxrNmbr, ixrOperMode);
     }
 //
 //    @ApiOperation(value = "TOD 구성 정보변경(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class)

+ 5 - 2
src/main/java/com/its/op/dao/repository/its/scrs/TbScIxrPhasRepository.java

@@ -5,6 +5,7 @@ import com.its.op.entity.its.scrs.TbScIxrPhasKey;
 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;
@@ -12,10 +13,12 @@ import java.util.List;
 @Repository
 public interface TbScIxrPhasRepository extends JpaRepository<TbScIxrPhas, TbScIxrPhasKey>, JpaSpecificationExecutor<TbScIxrPhas> {
 
-    @Query("select p from TbScIxrPhas p")
-    List<TbScIxrPhas> findAll();
+//    @Query("select p from TbScIxrPhas p")
+//    List<TbScIxrPhas> findAll();
 
     @Query("select p from TbScIxrPhas p")
     List<TbScIxrPhas> findAllList();
 
+    @Query("select p from TbScIxrPhas p where p.sgnlIxrNmbr = :sgnlIxrNmbr")
+    List<TbScIxrPhas> findListById(@Param("sgnlIxrNmbr") Integer sgnlIxrNmbr);
 }

+ 3 - 0
src/main/java/com/its/op/dao/repository/its/scrs/TbScTodCnfgRepository.java

@@ -5,6 +5,7 @@ import com.its.op.entity.its.scrs.TbScTodCnfgKey;
 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,6 @@ public interface TbScTodCnfgRepository extends JpaRepository<TbScTodCnfg, TbScTo
     @Query("select p from TbScTodCnfg p")
     List<TbScTodCnfg> findAllList();
 
+    @Query("select p from TbScTodCnfg p where p.sgnlIxrNmbr = :sgnlIxrNmbr and p.ixrOperMode = :ixrOperMode")
+    List<TbScTodCnfg> findListById(@Param("sgnlIxrNmbr") Integer sgnlIxrNmbr, @Param("ixrOperMode") Integer ixrOperMode);
 }

+ 9 - 0
src/main/java/com/its/op/service/its/scrs/TbScIxrPhasService.java

@@ -112,4 +112,13 @@ public class TbScIxrPhasService {
         return result;
     }
 
+    @Transactional(readOnly = true)
+    public List<TbScIxrPhasDto> findListById(Integer sgnlIxrNmbr) {
+        List<TbScIxrPhas> data = this.repo.findListById(sgnlIxrNmbr);
+        List<TbScIxrPhasDto> result = new ArrayList<>();
+        for (TbScIxrPhas entity : data) {
+            result.add(entity.toDto());
+        }
+        return result;
+    }
 }

+ 9 - 0
src/main/java/com/its/op/service/its/scrs/TbScTodCnfgService.java

@@ -112,4 +112,13 @@ public class TbScTodCnfgService {
         return result;
     }
 
+    @Transactional(readOnly = true)
+    public List<TbScTodCnfgDto> findListById(Integer sgnlIxrNmbr, Integer ixrOperMode) {
+        List<TbScTodCnfgDto> result = new ArrayList<>();
+        List<TbScTodCnfg> data = this.repo.findListById(sgnlIxrNmbr, ixrOperMode);
+        for (TbScTodCnfg entity : data) {
+            result.add(entity.toDto());
+        }
+        return result;
+    }
 }

+ 6 - 0
src/main/java/com/its/op/service/its/scrs/TbScTrfcCndtMngmService.java

@@ -55,6 +55,12 @@ public class TbScTrfcCndtMngmService {
     }
 
     // 데이터 1건 조회(기존 데이터가 반드시 존재해야 함)
+    @Transactional(readOnly = true)
+    public TbScTrfcCndtMngmDto findById(TbScTrfcCndtMngmKey ixrId) {
+        TbScTrfcCndtMngm entity = requireOne(ixrId);
+        return entity.toDto();
+    }
+
     @Transactional(readOnly = true)
     public List<TbScTrfcCndtMngmDto> findListById(String ixrId) {
         List<TbScTrfcCndtMngm> data = this.repo.findListById(ixrId);