shjung 2 år sedan
förälder
incheckning
66b13310ac

+ 17 - 0
src/main/java/com/its/op/controller/its/facility/TbFcltFailController.java

@@ -72,6 +72,23 @@ public class TbFcltFailController {
         return this.service.findAllListByDate(false, fromDay, toDay);
     }
 
+
+    @ApiOperation(value = "유형별 시설물 장애 현황 조회(완료항목 포함)", response = TbFcltFailDto.class, responseContainer = "ArrayList")
+    @GetMapping(value = "/list/type/all/{type}/{fromDay}/{toDay}", produces = {"application/json; charset=utf8"})
+    public List<TbFcltFailDto> findAllTypeListByDate(@PathVariable("type") final String type,
+                                                     @PathVariable("fromDay") final String fromDay,
+                                                 @PathVariable("toDay") final String toDay) {
+        return this.service.findAllTypeListByDate(type, true, fromDay, toDay);
+    }
+
+    @ApiOperation(value = "유형별 시설물 장애 관리 목록 조회(완료항목제외)", response = TbFcltFailDto.class, responseContainer = "ArrayList")
+    @GetMapping(value = "/list/type/mng/{type}/{fromDay}/{toDay}", produces = {"application/json; charset=utf8"})
+    public List<TbFcltFailDto> findRegTypeListByDate(@PathVariable("type") final String type,
+                                                     @PathVariable("fromDay") final String fromDay,
+                                                 @PathVariable("toDay") final String toDay) {
+        return this.service.findAllTypeListByDate(type, false, fromDay, toDay);
+    }
+
     @ApiOperation(value = "시설물 장애 발생 정보 개별조회(TB_FCLT_FAIL)", response = TbFcltFailDto.class)
     @GetMapping(value = "/{failNo}", produces = {"application/json; charset=utf8"})
     public TbFcltFailDto findById(@PathVariable("failNo") final String failNo) {

+ 1 - 1
src/main/java/com/its/op/controller/its/scrs/ScTfvlStatisticsController.java

@@ -39,7 +39,7 @@ public class ScTfvlStatisticsController {
             @PathVariable("ixrId") final String ixrId,
             @ApiParam(name = "cmraIds", value = "카메라 목록", example = "[1,2]", required = true)
             @RequestParam List<String> cmraIds,
-            @ApiParam(name = "lanes", value = "차선", example = "[1,2]", required = true)
+            @ApiParam(name = "lanes", value = "차선", example = "[1,2]", required = false)
             @RequestParam List<Integer> lanes,
             @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH240000)", example = "20210112150000", required = true)
             @RequestParam String FROM_DT,

+ 7 - 0
src/main/java/com/its/op/dao/repository/its/facility/TbFcltFailRepository.java

@@ -28,9 +28,16 @@ public interface TbFcltFailRepository extends JpaRepository<TbFcltFail, String>,
     @Query("select p from TbFcltFail p where p.strDt between :fromDt and :toDt")
     List<TbFcltFail> findListAll(@Param("fromDt") String fromDt, @Param("toDt") String toDt);
 
+
+    @Query("select p from TbFcltFail p, TbFcltInfr m where m.fcltType = :fcltType and m.fcltNmbr = p.fcltNmbr and p.strDt between :fromDt and :toDt")
+    List<TbFcltFail> findListTypeAll(@Param("fcltType") String fcltType, @Param("fromDt") String fromDt, @Param("toDt") String toDt);
+
     @Query("select p from TbFcltFail p where p.stepCd <> 'ACT2' and p.strDt between :fromDt and :toDt")
     List<TbFcltFail> findListContinuous(@Param("fromDt") String fromDt, @Param("toDt") String toDt);
 
+    @Query("select p from TbFcltFail p, TbFcltInfr m where m.fcltType = :fcltType and m.fcltNmbr = p.fcltNmbr and p.stepCd <> 'ACT2' and p.strDt between :fromDt and :toDt")
+    List<TbFcltFail> findListTypeContinuous(@Param("fcltType") String fcltType, @Param("fromDt") String fromDt, @Param("toDt") String toDt);
+
     @Modifying
     @Query(value = "UPDATE TB_FCLT_FAIL SET STEP_CD = :stepCd WHERE FAIL_NO = :failNo", nativeQuery = true)
     Integer updateStepCd(@Param("failNo") String failNo, @Param("stepCd") String stepCd);

+ 1 - 1
src/main/java/com/its/op/dao/repository/its/vms/TbVmsCtlrSttsHsRepository.java

@@ -66,7 +66,7 @@ public interface TbVmsCtlrSttsHsRepository extends JpaRepository<TbVmsCtlrSttsHs
 
 
     @Query(value =
-            "SELECT 'VMS' AS fcltType, A.VMS_CTLR_NMBR AS fcltNmbr, A.VMS_ID AS fcltId, A.VMS_NM AS fcltNm,                  " +
+            "SELECT 'VMS' AS fcltType, A.VMS_CTLR_NMBR AS fcltNmbr, A.VMS_CTLR_ID AS fcltId, A.VMS_NM AS fcltNm,                  " +
             "       B.CMNC_STTS_CD AS commSttsCd, B.DOOR_STTS_CD AS doorSttsCd, NVL(B.CBOX_TMPR, 0) AS cboxTmpr, B.CRTN_DT AS crtnDt " +
             "  FROM TB_VMS_CTLR A,                                                                                           " +
             "       (SELECT VMS_CTLR_NMBR, CMNC_STTS_CD AS CMNC_STTS_CD,                                                     " +

+ 26 - 1
src/main/java/com/its/op/service/its/facility/TbFcltFailService.java

@@ -187,7 +187,32 @@ public class TbFcltFailService {
             data = this.repo.findListContinuous(fromDay + "000000", toDay + "235959");
         }
         for (TbFcltFail entity : data) {
-            // TODO
+            // TODO:2023
+            result.add(entity.toDto());
+        }
+        return result;
+    }
+
+    /**
+     * 유형별 장애 현황 목록 조회
+     * @param all : true(모든 데이터 조회), false(조치완료된 항목 제외)
+     * @param fcltType
+     * @param fromDay
+     * @param toDay
+     * @return
+     */
+    @Transactional(readOnly = true)
+    public List<TbFcltFailDto> findAllTypeListByDate(String fcltType, boolean all, String fromDay, String toDay) {
+        List<TbFcltFailDto> result = new ArrayList<>();
+        List<TbFcltFail> data;
+        if (all) {
+            data = this.repo.findListTypeAll(fcltType, fromDay + "000000", toDay + "235959");
+        }
+        else {
+            data = this.repo.findListTypeContinuous(fcltType, fromDay + "000000", toDay + "235959");
+        }
+        for (TbFcltFail entity : data) {
+            // TODO:2023
             result.add(entity.toDto());
         }
         return result;

+ 1 - 0
src/main/java/com/its/op/service/its/facility/TbFcltSttsErrorHsService.java

@@ -34,6 +34,7 @@ public class TbFcltSttsErrorHsService {
      */
     @Transactional(readOnly = true)
     public List<FcltSttsErrorDto> findAllFcltSttsErrorList(String type, String fromDt, String toDt) throws NoSuchElementException {
+        //TODO:2023
         if (("CCTV").equalsIgnoreCase(type)) {
             return findAllStatisticsCommErrByDateRangeResult(this.cctvSttsHsRepo.findAllSttsErrorByDateRange(fromDt, toDt), type);
         }