diff --git a/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java b/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java index 9106c7af..95dba9e6 100644 --- a/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/mapsheet/dto/MapSheetMngDto.java @@ -74,8 +74,11 @@ public class MapSheetMngDto { private Long syncStateDoneCnt; private Long syncDataCheckDoneCnt; private Long syncNotPaireCnt; + private Long syncNotPaireExecCnt; private Long syncDuplicateCnt; + private Long syncDuplicateExecCnt; private Long syncFaultCnt; + private Long syncFaultExecCnt; @JsonFormatDttm private ZonedDateTime rgstStrtDttm; @JsonFormatDttm private ZonedDateTime rgstEndDttm; @@ -92,6 +95,14 @@ public class MapSheetMngDto { } return (double) this.syncDataCheckDoneCnt / this.syncTotCnt * 100.0; } + + public long getSyncErrorTotCnt() { + return this.syncNotPaireCnt + this.syncDuplicateCnt + this.syncFaultCnt; + } + + public long getSyncErrorExecTotCnt() { + return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt; + } } @Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청") diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java index 305e466b..6407bfd5 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/mapsheet/MapSheetMngRepositoryImpl.java @@ -54,13 +54,12 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport NumberExpression totalCount = mapSheetMngHstEntity.count().as("syncTotCnt"); - NumberExpression doneCount = - new CaseBuilder() - .when(mapSheetMngHstEntity.dataState.eq("DONE")) - .then(1L) - .otherwise(0L) - .sum() - .as("syncStateDoneCnt"); + NumberExpression doneCount = new CaseBuilder() + .when(mapSheetMngHstEntity.dataState.eq("DONE")) + .then(1L) + .otherwise(0L) + .sum() + .as("syncStateDoneCnt"); List foundContent = queryFactory @@ -88,28 +87,46 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport .otherwise(0L) .sum(), new CaseBuilder() - .when( - mapSheetMngHstEntity - .syncState - .eq("NOFILE") - .or(mapSheetMngHstEntity.syncState.eq("NOTPAIR"))) + .when(mapSheetMngHstEntity.syncState.eq("NOFILE") + .or( mapSheetMngHstEntity.syncState.eq("NOTPAIR"))) .then(1L) .otherwise(0L) .sum(), new CaseBuilder() - .when(mapSheetMngHstEntity.syncState.eq("DUPLICATE")) - .then(1L) - .otherwise(0L) - .sum(), + .when(mapSheetMngHstEntity.syncCheckState.eq("DONE") + .and( mapSheetMngHstEntity.syncState.eq("NOFILE") + .or(mapSheetMngHstEntity.syncState.eq("NOTPAIR")) ) + ) + .then(1L) + .otherwise(0L) + .sum(), + new CaseBuilder() - .when( - mapSheetMngHstEntity - .syncState - .eq("TYPEERROR") - .or(mapSheetMngHstEntity.syncState.eq("SIZEERROR"))) - .then(1L) - .otherwise(0L) - .sum(), + .when(mapSheetMngHstEntity.syncState.eq("DUPLICATE")) + .then(1L) + .otherwise(0L) + .sum(), + new CaseBuilder() + .when(mapSheetMngHstEntity.syncCheckState.eq("DONE") + .and(mapSheetMngHstEntity.syncState.eq("DUPLICATE")) ) + .then(1L) + .otherwise(0L) + .sum(), + + new CaseBuilder() + .when(mapSheetMngHstEntity.syncState.eq("TYPEERROR") + .or( mapSheetMngHstEntity.syncState.eq("SIZEERROR"))) + .then(1L) + .otherwise(0L) + .sum(), + new CaseBuilder() + .when(mapSheetMngHstEntity.syncCheckState.eq("DONE") + .and(mapSheetMngHstEntity.syncState.eq("TYPEERROR") + .or( mapSheetMngHstEntity.syncState.eq("SIZEERROR"))) ) + .then(1L) + .otherwise(0L) + .sum(), + mapSheetMngEntity.createdDttm, mapSheetMngHstEntity.syncEndDttm.max())) .from(mapSheetMngEntity)