모델별 데이터셋 목록 조회 수정
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package com.kamco.cd.training.dataset.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.kamco.cd.training.common.enums.LearnDataRegister;
|
||||
import com.kamco.cd.training.common.enums.LearnDataType;
|
||||
import com.kamco.cd.training.common.enums.ModelType;
|
||||
import com.kamco.cd.training.common.utils.enums.Enums;
|
||||
import com.kamco.cd.training.common.utils.interfaces.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -228,6 +230,7 @@ public class DatasetDto {
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class SelectDataSet {
|
||||
|
||||
private String modelNo; // G1, G2, G3 모델 타입
|
||||
private Long datasetId;
|
||||
private UUID uuid;
|
||||
private String dataType;
|
||||
@@ -236,12 +239,16 @@ public class DatasetDto {
|
||||
private Integer compareYyyy;
|
||||
private Integer targetYyyy;
|
||||
private String memo;
|
||||
private Long classCount;
|
||||
private Integer buildingCount;
|
||||
private Integer containerCount;
|
||||
@JsonIgnore private Long classCount;
|
||||
private Integer buildingCnt;
|
||||
private Integer containerCnt;
|
||||
private String dataTypeName;
|
||||
|
||||
private Long wasteCnt;
|
||||
private Long landCoverCnt;
|
||||
|
||||
public SelectDataSet(
|
||||
String modelNo,
|
||||
Long datasetId,
|
||||
UUID uuid,
|
||||
String dataType,
|
||||
@@ -260,9 +267,15 @@ public class DatasetDto {
|
||||
this.targetYyyy = targetYyyy;
|
||||
this.memo = memo;
|
||||
this.classCount = classCount;
|
||||
if (modelNo.equals(ModelType.G2.getId())) {
|
||||
this.wasteCnt = classCount;
|
||||
} else if (modelNo.equals(ModelType.G3.getId())) {
|
||||
this.landCoverCnt = classCount;
|
||||
}
|
||||
}
|
||||
|
||||
public SelectDataSet(
|
||||
String modelNo,
|
||||
Long datasetId,
|
||||
UUID uuid,
|
||||
String dataType,
|
||||
@@ -271,8 +284,8 @@ public class DatasetDto {
|
||||
Integer compareYyyy,
|
||||
Integer targetYyyy,
|
||||
String memo,
|
||||
Integer buildingCount,
|
||||
Integer containerCount) {
|
||||
Integer buildingCnt,
|
||||
Integer containerCnt) {
|
||||
this.datasetId = datasetId;
|
||||
this.uuid = uuid;
|
||||
this.dataType = dataType;
|
||||
@@ -282,8 +295,8 @@ public class DatasetDto {
|
||||
this.compareYyyy = compareYyyy;
|
||||
this.targetYyyy = targetYyyy;
|
||||
this.memo = memo;
|
||||
this.buildingCount = buildingCount;
|
||||
this.containerCount = containerCount;
|
||||
this.buildingCnt = buildingCnt;
|
||||
this.containerCnt = containerCnt;
|
||||
}
|
||||
|
||||
public String getDataTypeName(String groupTitleCd) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.kamco.cd.training.postgres.entity.QDatasetEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
@@ -103,6 +104,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
.select(
|
||||
Projections.constructor(
|
||||
SelectDataSet.class,
|
||||
Expressions.constant(req.getModelNo()),
|
||||
dataset.id,
|
||||
dataset.uuid,
|
||||
dataset.dataType,
|
||||
@@ -174,6 +176,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
.select(
|
||||
Projections.constructor(
|
||||
SelectDataSet.class,
|
||||
Expressions.constant(req.getModelNo()),
|
||||
dataset.id,
|
||||
dataset.uuid,
|
||||
dataset.dataType,
|
||||
|
||||
Reference in New Issue
Block a user