데이터셋 조회 class count integer -> Long 로 변경

This commit is contained in:
2026-04-03 15:17:17 +09:00
parent 26d34d88eb
commit e77eae8f8b
2 changed files with 18 additions and 36 deletions

View File

@@ -125,15 +125,15 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
new CaseBuilder()
.when(
datasetObjEntity.targetClassCd.eq(DetectionClassification.BUILDING.getId()))
.then(1)
.otherwise(0)
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(
datasetObjEntity.targetClassCd.eq(
DetectionClassification.CONTAINER.getId()))
.then(1)
.otherwise(0)
.then(1L)
.otherwise(0L)
.sum()))
.from(dataset)
.leftJoin(datasetObjEntity)
@@ -262,6 +262,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
builder.and(dataset.deleted.isFalse());
NumberExpression<Long> selectedCnt = null;
// G2
NumberExpression<Long> wasteCnt =
datasetObjEntity
.targetClassCd
@@ -270,7 +271,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
.otherwise(0L)
.sum();
// G1, G2, G4 제외
// G3 (G1, G2, G4 제외)
NumberExpression<Long> elseCnt =
new CaseBuilder()
.when(datasetObjEntity.targetClassCd.notIn(building, container, waste, solar))
@@ -281,7 +282,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
if (StringUtils.isNotBlank(req.getModelNo())) {
if (req.getModelNo().equals(ModelType.G2.getId())) {
selectedCnt = wasteCnt;
} else {
} else if (req.getModelNo().equals(ModelType.G3.getId())) {
selectedCnt = elseCnt;
}
}
@@ -523,8 +524,8 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
dataset.memo,
new CaseBuilder()
.when(datasetObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()))
.then(1)
.otherwise(0)
.then(1L)
.otherwise(0L)
.sum()))
.from(dataset)
.leftJoin(datasetObjEntity)