추론결과 목록조회 수정
This commit is contained in:
@@ -69,8 +69,8 @@ public class InferenceResultCoreService {
|
||||
* @return
|
||||
*/
|
||||
public Page<ResultList> getInferenceResultList(InferenceResultDto.SearchListReq req) {
|
||||
Page<ResultList> list = mapSheetLearnRepository.getInferenceMgnResultList(req);
|
||||
return list;
|
||||
Page<MapSheetLearnEntity> list = mapSheetLearnRepository.getInferenceMgnResultList(req);
|
||||
return list.map(MapSheetLearnEntity::toDto);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +110,7 @@ public class InferenceResultCoreService {
|
||||
mapSheetLearnEntity.setDetectOption(req.getDetectOption());
|
||||
mapSheetLearnEntity.setCreatedUid(userUtil.getId());
|
||||
mapSheetLearnEntity.setMapSheetCnt(mapSheetName);
|
||||
mapSheetLearnEntity.setDetectingCnt((long) detectingCnt);
|
||||
mapSheetLearnEntity.setDetectingCnt(0L);
|
||||
// 회차는 국유인 반영할때 update로 변경됨
|
||||
// mapSheetLearnEntity.setStage(
|
||||
// mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy()));
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -19,7 +18,7 @@ import org.springframework.data.domain.Page;
|
||||
|
||||
public interface MapSheetLearnRepositoryCustom {
|
||||
|
||||
Page<ResultList> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
||||
Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
||||
|
||||
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
||||
|
||||
|
||||
@@ -24,10 +24,8 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.model.service.ModelMngService;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QInferenceResultsTestingEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity;
|
||||
@@ -62,7 +60,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
private final ModelMngService modelMngService;
|
||||
|
||||
@Override
|
||||
public Page<ResultList> getInferenceMgnResultList(InferenceResultDto.SearchListReq req) {
|
||||
public Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req) {
|
||||
Pageable pageable = req.toPageable();
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
@@ -92,75 +90,24 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle()));
|
||||
}
|
||||
|
||||
QInferenceResultsTestingEntity irt =
|
||||
QInferenceResultsTestingEntity.inferenceResultsTestingEntity;
|
||||
BooleanExpression joinCond =
|
||||
mapSheetLearnEntity
|
||||
.m1ModelBatchId
|
||||
.isNotNull()
|
||||
.and(irt.batchId.eq(mapSheetLearnEntity.m1ModelBatchId))
|
||||
.or(
|
||||
mapSheetLearnEntity
|
||||
.m2ModelBatchId
|
||||
.isNotNull()
|
||||
.and(irt.batchId.eq(mapSheetLearnEntity.m2ModelBatchId)))
|
||||
.or(
|
||||
mapSheetLearnEntity
|
||||
.m3ModelBatchId
|
||||
.isNotNull()
|
||||
.and(irt.batchId.eq(mapSheetLearnEntity.m3ModelBatchId)));
|
||||
|
||||
List<ResultList> content =
|
||||
List<MapSheetLearnEntity> content =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
ResultList.class,
|
||||
mapSheetLearnEntity.uuid,
|
||||
mapSheetLearnEntity.title,
|
||||
mapSheetLearnEntity.stage,
|
||||
mapSheetLearnEntity.status,
|
||||
mapSheetLearnEntity.mapSheetCnt,
|
||||
irt.seq.count(),
|
||||
mapSheetLearnEntity.inferStartDttm,
|
||||
mapSheetLearnEntity.inferEndDttm,
|
||||
mapSheetLearnEntity.applyYn,
|
||||
mapSheetLearnEntity.applyDttm,
|
||||
mapSheetLearnEntity.compareYyyy,
|
||||
mapSheetLearnEntity.targetYyyy,
|
||||
mapSheetLearnEntity.uid))
|
||||
.select(mapSheetLearnEntity)
|
||||
.from(mapSheetLearnEntity)
|
||||
.leftJoin(irt)
|
||||
.on(joinCond)
|
||||
.where(builder)
|
||||
.groupBy(
|
||||
mapSheetLearnEntity.id,
|
||||
mapSheetLearnEntity.uuid,
|
||||
mapSheetLearnEntity.title,
|
||||
mapSheetLearnEntity.stage,
|
||||
mapSheetLearnEntity.status,
|
||||
mapSheetLearnEntity.mapSheetCnt,
|
||||
mapSheetLearnEntity.inferStartDttm,
|
||||
mapSheetLearnEntity.inferEndDttm,
|
||||
mapSheetLearnEntity.applyYn,
|
||||
mapSheetLearnEntity.applyDttm,
|
||||
mapSheetLearnEntity.compareYyyy,
|
||||
mapSheetLearnEntity.targetYyyy,
|
||||
mapSheetLearnEntity.uid)
|
||||
.orderBy(mapSheetLearnEntity.id.desc())
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetLearnEntity.id.desc())
|
||||
.fetch();
|
||||
|
||||
Long total =
|
||||
Optional.ofNullable(
|
||||
queryFactory
|
||||
.select(mapSheetLearnEntity.count())
|
||||
.from(mapSheetLearnEntity)
|
||||
.where(builder)
|
||||
.fetchOne())
|
||||
.orElse(0L);
|
||||
queryFactory
|
||||
.select(mapSheetLearnEntity.count())
|
||||
.from(mapSheetLearnEntity)
|
||||
.where(builder)
|
||||
.fetchOne();
|
||||
|
||||
return new PageImpl<>(content, pageable, total);
|
||||
return new PageImpl<>(content, pageable, total == null ? 0L : total);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user