diff --git a/src/main/java/com/kamco/cd/training/dataset/dto/DatasetDto.java b/src/main/java/com/kamco/cd/training/dataset/dto/DatasetDto.java index 1e7c770..cee6ad5 100644 --- a/src/main/java/com/kamco/cd/training/dataset/dto/DatasetDto.java +++ b/src/main/java/com/kamco/cd/training/dataset/dto/DatasetDto.java @@ -231,28 +231,34 @@ public class DatasetDto { private Long datasetId; private UUID uuid; - private String groupTitle; + private String dataType; private String yyyy; private Long roundNo; + private Integer compareYyyy; + private Integer targetYyyy; private String memo; private Long classCount; private Integer buildingCount; private Integer containerCount; - private String groupTitleCd; + private String dataTypeName; public SelectDataSet( Long datasetId, UUID uuid, - String groupTitle, + String dataType, String yyyy, Long roundNo, + Integer compareYyyy, + Integer targetYyyy, String memo, Long classCount) { this.datasetId = datasetId; this.uuid = uuid; - this.groupTitle = groupTitle; + this.dataType = dataType; this.yyyy = yyyy; this.roundNo = roundNo; + this.compareYyyy = compareYyyy; + this.targetYyyy = targetYyyy; this.memo = memo; this.classCount = classCount; } @@ -260,26 +266,34 @@ public class DatasetDto { public SelectDataSet( Long datasetId, UUID uuid, - String groupTitle, + String dataType, String yyyy, Long roundNo, + Integer compareYyyy, + Integer targetYyyy, String memo, Integer buildingCount, Integer containerCount) { this.datasetId = datasetId; this.uuid = uuid; - this.groupTitle = getGroupTitle(groupTitle); - this.groupTitleCd = groupTitle; + this.dataType = dataType; + this.dataTypeName = getDataTypeName(dataType); this.yyyy = yyyy; this.roundNo = roundNo; + this.compareYyyy = compareYyyy; + this.targetYyyy = targetYyyy; this.memo = memo; this.buildingCount = buildingCount; this.containerCount = containerCount; } - public String getGroupTitle(String groupTitleCd) { + public String getDataTypeName(String groupTitleCd) { LearnDataType type = Enums.fromId(LearnDataType.class, groupTitleCd); return type == null ? null : type.getText(); } + + public String getYear() { + return this.compareYyyy + "-" + this.targetYyyy; + } } } diff --git a/src/main/java/com/kamco/cd/training/postgres/repository/dataset/DatasetRepositoryImpl.java b/src/main/java/com/kamco/cd/training/postgres/repository/dataset/DatasetRepositoryImpl.java index 9002664..a60525b 100644 --- a/src/main/java/com/kamco/cd/training/postgres/repository/dataset/DatasetRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/training/postgres/repository/dataset/DatasetRepositoryImpl.java @@ -97,6 +97,8 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom { dataset.dataType, dataset.title, dataset.roundNo, + dataset.compareYyyy, + dataset.targetYyyy, dataset.memo, new CaseBuilder() .when(datasetObjEntity.targetClassCd.eq("building")) @@ -158,6 +160,8 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom { dataset.dataType, dataset.title, dataset.roundNo, + dataset.compareYyyy, + dataset.targetYyyy, dataset.memo, selectedCnt.as("cnt"))) .from(dataset)