데이터셋 조회 class count integer -> Long 로 변경 #188
@@ -248,13 +248,13 @@ public class DatasetDto {
|
|||||||
private Integer targetYyyy;
|
private Integer targetYyyy;
|
||||||
private String memo;
|
private String memo;
|
||||||
@JsonIgnore private Long classCount;
|
@JsonIgnore private Long classCount;
|
||||||
private Integer buildingCnt;
|
private Long buildingCnt;
|
||||||
private Integer containerCnt;
|
private Long containerCnt;
|
||||||
private String dataTypeName;
|
private String dataTypeName;
|
||||||
|
|
||||||
private Long wasteCnt;
|
private Long wasteCnt;
|
||||||
private Long landCoverCnt;
|
private Long landCoverCnt;
|
||||||
private Integer solarPanelCnt;
|
private Long solarPanelCnt;
|
||||||
|
|
||||||
public SelectDataSet(
|
public SelectDataSet(
|
||||||
String modelNo,
|
String modelNo,
|
||||||
@@ -267,6 +267,7 @@ public class DatasetDto {
|
|||||||
Integer targetYyyy,
|
Integer targetYyyy,
|
||||||
String memo,
|
String memo,
|
||||||
Long classCount) {
|
Long classCount) {
|
||||||
|
this.modelNo = modelNo;
|
||||||
this.datasetId = datasetId;
|
this.datasetId = datasetId;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.dataType = dataType;
|
this.dataType = dataType;
|
||||||
@@ -281,6 +282,8 @@ public class DatasetDto {
|
|||||||
this.wasteCnt = classCount;
|
this.wasteCnt = classCount;
|
||||||
} else if (modelNo.equals(ModelType.G3.getId())) {
|
} else if (modelNo.equals(ModelType.G3.getId())) {
|
||||||
this.landCoverCnt = classCount;
|
this.landCoverCnt = classCount;
|
||||||
|
} else if (modelNo.equals(ModelType.G4.getId())) {
|
||||||
|
this.solarPanelCnt = classCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,8 +297,9 @@ public class DatasetDto {
|
|||||||
Integer compareYyyy,
|
Integer compareYyyy,
|
||||||
Integer targetYyyy,
|
Integer targetYyyy,
|
||||||
String memo,
|
String memo,
|
||||||
Integer buildingCnt,
|
Long buildingCnt,
|
||||||
Integer containerCnt) {
|
Long containerCnt) {
|
||||||
|
this.modelNo = modelNo;
|
||||||
this.datasetId = datasetId;
|
this.datasetId = datasetId;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.dataType = dataType;
|
this.dataType = dataType;
|
||||||
@@ -309,29 +313,6 @@ public class DatasetDto {
|
|||||||
this.containerCnt = containerCnt;
|
this.containerCnt = containerCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SelectDataSet(
|
|
||||||
String modelNo,
|
|
||||||
Long datasetId,
|
|
||||||
UUID uuid,
|
|
||||||
String dataType,
|
|
||||||
String title,
|
|
||||||
Long roundNo,
|
|
||||||
Integer compareYyyy,
|
|
||||||
Integer targetYyyy,
|
|
||||||
String memo,
|
|
||||||
Integer solarPanelCnt) {
|
|
||||||
this.datasetId = datasetId;
|
|
||||||
this.uuid = uuid;
|
|
||||||
this.dataType = dataType;
|
|
||||||
this.dataTypeName = getDataTypeName(dataType);
|
|
||||||
this.title = title;
|
|
||||||
this.roundNo = roundNo;
|
|
||||||
this.compareYyyy = compareYyyy;
|
|
||||||
this.targetYyyy = targetYyyy;
|
|
||||||
this.memo = memo;
|
|
||||||
this.solarPanelCnt = solarPanelCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataTypeName(String groupTitleCd) {
|
public String getDataTypeName(String groupTitleCd) {
|
||||||
LearnDataType type = Enums.fromId(LearnDataType.class, groupTitleCd);
|
LearnDataType type = Enums.fromId(LearnDataType.class, groupTitleCd);
|
||||||
return type == null ? null : type.getText();
|
return type == null ? null : type.getText();
|
||||||
|
|||||||
@@ -125,15 +125,15 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
|||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(
|
.when(
|
||||||
datasetObjEntity.targetClassCd.eq(DetectionClassification.BUILDING.getId()))
|
datasetObjEntity.targetClassCd.eq(DetectionClassification.BUILDING.getId()))
|
||||||
.then(1)
|
.then(1L)
|
||||||
.otherwise(0)
|
.otherwise(0L)
|
||||||
.sum(),
|
.sum(),
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(
|
.when(
|
||||||
datasetObjEntity.targetClassCd.eq(
|
datasetObjEntity.targetClassCd.eq(
|
||||||
DetectionClassification.CONTAINER.getId()))
|
DetectionClassification.CONTAINER.getId()))
|
||||||
.then(1)
|
.then(1L)
|
||||||
.otherwise(0)
|
.otherwise(0L)
|
||||||
.sum()))
|
.sum()))
|
||||||
.from(dataset)
|
.from(dataset)
|
||||||
.leftJoin(datasetObjEntity)
|
.leftJoin(datasetObjEntity)
|
||||||
@@ -262,6 +262,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
|||||||
builder.and(dataset.deleted.isFalse());
|
builder.and(dataset.deleted.isFalse());
|
||||||
|
|
||||||
NumberExpression<Long> selectedCnt = null;
|
NumberExpression<Long> selectedCnt = null;
|
||||||
|
// G2
|
||||||
NumberExpression<Long> wasteCnt =
|
NumberExpression<Long> wasteCnt =
|
||||||
datasetObjEntity
|
datasetObjEntity
|
||||||
.targetClassCd
|
.targetClassCd
|
||||||
@@ -270,7 +271,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
|||||||
.otherwise(0L)
|
.otherwise(0L)
|
||||||
.sum();
|
.sum();
|
||||||
|
|
||||||
// G1, G2, G4 제외
|
// G3 (G1, G2, G4 제외)
|
||||||
NumberExpression<Long> elseCnt =
|
NumberExpression<Long> elseCnt =
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(datasetObjEntity.targetClassCd.notIn(building, container, waste, solar))
|
.when(datasetObjEntity.targetClassCd.notIn(building, container, waste, solar))
|
||||||
@@ -281,7 +282,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
|||||||
if (StringUtils.isNotBlank(req.getModelNo())) {
|
if (StringUtils.isNotBlank(req.getModelNo())) {
|
||||||
if (req.getModelNo().equals(ModelType.G2.getId())) {
|
if (req.getModelNo().equals(ModelType.G2.getId())) {
|
||||||
selectedCnt = wasteCnt;
|
selectedCnt = wasteCnt;
|
||||||
} else {
|
} else if (req.getModelNo().equals(ModelType.G3.getId())) {
|
||||||
selectedCnt = elseCnt;
|
selectedCnt = elseCnt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -523,8 +524,8 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
|||||||
dataset.memo,
|
dataset.memo,
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(datasetObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()))
|
.when(datasetObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()))
|
||||||
.then(1)
|
.then(1L)
|
||||||
.otherwise(0)
|
.otherwise(0L)
|
||||||
.sum()))
|
.sum()))
|
||||||
.from(dataset)
|
.from(dataset)
|
||||||
.leftJoin(datasetObjEntity)
|
.leftJoin(datasetObjEntity)
|
||||||
|
|||||||
Reference in New Issue
Block a user