Merge branch 'feat/infer_dev_260107' of https://10.100.0.10:3210/dabeeo/kamco-dabeeo-backoffice into feat/infer_dev_260107
This commit is contained in:
@@ -19,6 +19,8 @@ import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapSheetLis
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||
@@ -174,27 +176,33 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
||||
|
||||
@Override
|
||||
public List<ChangeDetectionDto.AnalYearList> getChangeDetectionYearList() {
|
||||
QMapSheetLearnEntity l = mapSheetLearnEntity;
|
||||
QMapSheetAnalInferenceEntity a = mapSheetAnalInferenceEntity;
|
||||
QMapSheetAnalDataInferenceEntity d = new QMapSheetAnalDataInferenceEntity("d2");
|
||||
|
||||
StringExpression mapSheetNumExpr =
|
||||
Expressions.stringTemplate(
|
||||
"cast({0} as string)",
|
||||
JPAExpressions.select(d.mapSheetNum.max()).from(d).where(d.analUid.eq(a.id)));
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
ChangeDetectionDto.AnalYearList.class,
|
||||
mapSheetLearnEntity.uuid,
|
||||
mapSheetLearnEntity.id,
|
||||
mapSheetLearnEntity.title,
|
||||
mapSheetLearnEntity.compareYyyy.as("beforeYear"),
|
||||
mapSheetLearnEntity.targetYyyy.as("afterYear"),
|
||||
Expressions.stringTemplate(
|
||||
"cast({0} as string)",
|
||||
JPAExpressions.select(d.mapSheetNum.max())
|
||||
.from(d)
|
||||
.where(d.analUid.eq(mapSheetAnalInferenceEntity.id)))))
|
||||
.from(mapSheetLearnEntity)
|
||||
.leftJoin(mapSheetAnalInferenceEntity)
|
||||
.on(mapSheetAnalInferenceEntity.learnId.eq(mapSheetLearnEntity.id))
|
||||
.where(mapSheetLearnEntity.status.eq(Status.END.getId()))
|
||||
.orderBy(mapSheetLearnEntity.id.asc())
|
||||
l.uuid,
|
||||
l.id,
|
||||
l.title,
|
||||
l.compareYyyy.as("beforeYear"),
|
||||
l.targetYyyy.as("afterYear"),
|
||||
mapSheetNumExpr))
|
||||
.from(l)
|
||||
.leftJoin(a)
|
||||
.on(a.learnId.eq(l.id))
|
||||
.where(
|
||||
l.status
|
||||
.eq(Status.END.getId())
|
||||
.and(JPAExpressions.selectOne().from(d).where(d.analUid.eq(a.id)).exists()))
|
||||
.orderBy(l.id.asc())
|
||||
.fetch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user