추론결과, 변화탐지 테이블 수정으로 인한 변경
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResList;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResSummary;
|
||||
@@ -9,7 +11,6 @@ import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalSttcEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QModelMngBakEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QModelVerEntity;
|
||||
@@ -41,8 +42,8 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
private final JPAQueryFactory queryFactory;
|
||||
private final QModelMngBakEntity tmm = QModelMngBakEntity.modelMngBakEntity;
|
||||
private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity;
|
||||
private final QMapSheetAnalInferenceEntity mapSheetAnalEntity =
|
||||
QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||
// private final QMapSheetAnalEntity mapSheetAnalEntity =
|
||||
// mapSheetAnalEntity;
|
||||
private final QMapSheetAnalDataInferenceEntity MapSheetAnalDataInferenceEntity =
|
||||
QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
|
||||
private final QMapSheetAnalDataInferenceGeomEntity MapSheetAnalDataInferenceGeomEntity =
|
||||
@@ -62,12 +63,12 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
// "0000" 전체조회
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
if (searchReq.getStatCode() != null && !"0000".equals(searchReq.getStatCode())) {
|
||||
builder.and(mapSheetAnalEntity.analState.eq(searchReq.getStatCode()));
|
||||
builder.and(mapSheetAnalInferenceEntity.analState.eq(searchReq.getStatCode()));
|
||||
}
|
||||
|
||||
// 제목
|
||||
if (searchReq.getTitle() != null) {
|
||||
builder.and(mapSheetAnalEntity.analTitle.like("%" + searchReq.getTitle() + "%"));
|
||||
builder.and(mapSheetAnalInferenceEntity.analTitle.like("%" + searchReq.getTitle() + "%"));
|
||||
}
|
||||
|
||||
List<AnalResList> content =
|
||||
@@ -75,28 +76,28 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
.select(
|
||||
Projections.constructor(
|
||||
InferenceResultDto.AnalResList.class,
|
||||
mapSheetAnalEntity.id,
|
||||
mapSheetAnalEntity.analTitle,
|
||||
mapSheetAnalEntity.detectingCnt,
|
||||
mapSheetAnalEntity.analStrtDttm,
|
||||
mapSheetAnalEntity.analEndDttm,
|
||||
mapSheetAnalEntity.analSec,
|
||||
mapSheetAnalEntity.analPredSec,
|
||||
mapSheetAnalEntity.analState,
|
||||
mapSheetAnalInferenceEntity.id,
|
||||
mapSheetAnalInferenceEntity.analTitle,
|
||||
mapSheetAnalInferenceEntity.detectingCnt,
|
||||
mapSheetAnalInferenceEntity.analStrtDttm,
|
||||
mapSheetAnalInferenceEntity.analEndDttm,
|
||||
mapSheetAnalInferenceEntity.analSec,
|
||||
mapSheetAnalInferenceEntity.analPredSec,
|
||||
mapSheetAnalInferenceEntity.analState,
|
||||
Expressions.stringTemplate(
|
||||
"fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState),
|
||||
mapSheetAnalEntity.gukyuinUsed))
|
||||
.from(mapSheetAnalEntity)
|
||||
"fn_code_name({0}, {1})", "0002", mapSheetAnalInferenceEntity.analState),
|
||||
mapSheetAnalInferenceEntity.gukyuinUsed))
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.where(builder)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetAnalEntity.id.desc())
|
||||
.orderBy(mapSheetAnalInferenceEntity.id.desc())
|
||||
.fetch();
|
||||
|
||||
long total =
|
||||
queryFactory
|
||||
.select(mapSheetAnalEntity.id)
|
||||
.from(mapSheetAnalEntity)
|
||||
.select(mapSheetAnalInferenceEntity.id)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.where(builder)
|
||||
.fetchCount();
|
||||
|
||||
@@ -122,27 +123,28 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
.select(
|
||||
Projections.constructor(
|
||||
InferenceResultDto.AnalResSummary.class,
|
||||
mapSheetAnalEntity.id,
|
||||
mapSheetAnalEntity.analTitle,
|
||||
mapSheetAnalInferenceEntity.id,
|
||||
mapSheetAnalInferenceEntity.analTitle,
|
||||
tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"),
|
||||
mapSheetAnalEntity.targetYyyy,
|
||||
mapSheetAnalEntity.compareYyyy,
|
||||
mapSheetAnalEntity.analStrtDttm,
|
||||
mapSheetAnalEntity.analEndDttm,
|
||||
mapSheetAnalEntity.analSec,
|
||||
mapSheetAnalEntity.analPredSec,
|
||||
mapSheetAnalEntity.resultUrl,
|
||||
mapSheetAnalEntity.detectingCnt,
|
||||
mapSheetAnalEntity.accuracy,
|
||||
mapSheetAnalEntity.analState,
|
||||
mapSheetAnalInferenceEntity.targetYyyy,
|
||||
mapSheetAnalInferenceEntity.compareYyyy,
|
||||
mapSheetAnalInferenceEntity.analStrtDttm,
|
||||
mapSheetAnalInferenceEntity.analEndDttm,
|
||||
mapSheetAnalInferenceEntity.analSec,
|
||||
mapSheetAnalInferenceEntity.analPredSec,
|
||||
mapSheetAnalInferenceEntity.resultUrl,
|
||||
mapSheetAnalInferenceEntity.detectingCnt,
|
||||
mapSheetAnalInferenceEntity.accuracy,
|
||||
mapSheetAnalInferenceEntity.analState,
|
||||
Expressions.stringTemplate(
|
||||
"fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState)))
|
||||
.from(mapSheetAnalEntity)
|
||||
"fn_code_name({0}, {1})",
|
||||
"0002", mapSheetAnalInferenceEntity.analState)))
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.leftJoin(tmm)
|
||||
.on(mapSheetAnalEntity.modelUid.eq(tmm.id))
|
||||
.on(mapSheetAnalInferenceEntity.modelUid.eq(tmm.id))
|
||||
.leftJoin(tmv)
|
||||
.on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub)))
|
||||
.where(mapSheetAnalEntity.id.eq(id))
|
||||
.where(mapSheetAnalInferenceEntity.id.eq(id))
|
||||
.fetchOne());
|
||||
return content;
|
||||
}
|
||||
@@ -231,7 +233,7 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
// 추론결과 id
|
||||
builder.and(mapSheetAnalEntity.id.eq(id));
|
||||
builder.and(mapSheetAnalInferenceEntity.id.eq(id));
|
||||
|
||||
// 기준년도 분류
|
||||
if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) {
|
||||
@@ -269,9 +271,9 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
MapSheetAnalDataInferenceGeomEntity.mapSheetNum,
|
||||
MapSheetAnalDataInferenceGeomEntity.geom,
|
||||
MapSheetAnalDataInferenceGeomEntity.geomCenter))
|
||||
.from(mapSheetAnalEntity)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(MapSheetAnalDataInferenceEntity)
|
||||
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id))
|
||||
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
|
||||
.join(MapSheetAnalDataInferenceGeomEntity)
|
||||
.on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id))
|
||||
.where(builder)
|
||||
@@ -282,9 +284,9 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
long total =
|
||||
queryFactory
|
||||
.select(MapSheetAnalDataInferenceGeomEntity.geoUid)
|
||||
.from(mapSheetAnalEntity)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(MapSheetAnalDataInferenceEntity)
|
||||
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id))
|
||||
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
|
||||
.join(MapSheetAnalDataInferenceGeomEntity)
|
||||
.on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id))
|
||||
.where(builder)
|
||||
@@ -303,10 +305,10 @@ public class MapSheetAnalDataInferenceRepositoryImpl
|
||||
public List<Long> getSheets(Long id) {
|
||||
return queryFactory
|
||||
.select(MapSheetAnalDataInferenceEntity.mapSheetNum)
|
||||
.from(mapSheetAnalEntity)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(MapSheetAnalDataInferenceEntity)
|
||||
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id))
|
||||
.where(mapSheetAnalEntity.id.eq(id))
|
||||
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
|
||||
.where(mapSheetAnalInferenceEntity.id.eq(id))
|
||||
.groupBy(MapSheetAnalDataInferenceEntity.mapSheetNum)
|
||||
.fetch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user