Merge pull request 'feat/infer_dev_260107' (#344) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/344
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.inference.dto.InferenceResultDto.Status;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
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.Projections;
|
||||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
import com.querydsl.core.types.dsl.CaseBuilder;
|
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||||
@@ -174,27 +176,33 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ChangeDetectionDto.AnalYearList> getChangeDetectionYearList() {
|
public List<ChangeDetectionDto.AnalYearList> getChangeDetectionYearList() {
|
||||||
|
QMapSheetLearnEntity l = mapSheetLearnEntity;
|
||||||
|
QMapSheetAnalInferenceEntity a = mapSheetAnalInferenceEntity;
|
||||||
QMapSheetAnalDataInferenceEntity d = new QMapSheetAnalDataInferenceEntity("d2");
|
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
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
ChangeDetectionDto.AnalYearList.class,
|
ChangeDetectionDto.AnalYearList.class,
|
||||||
mapSheetLearnEntity.uuid,
|
l.uuid,
|
||||||
mapSheetLearnEntity.id,
|
l.id,
|
||||||
mapSheetLearnEntity.title,
|
l.title,
|
||||||
mapSheetLearnEntity.compareYyyy.as("beforeYear"),
|
l.compareYyyy.as("beforeYear"),
|
||||||
mapSheetLearnEntity.targetYyyy.as("afterYear"),
|
l.targetYyyy.as("afterYear"),
|
||||||
Expressions.stringTemplate(
|
mapSheetNumExpr))
|
||||||
"cast({0} as string)",
|
.from(l)
|
||||||
JPAExpressions.select(d.mapSheetNum.max())
|
.leftJoin(a)
|
||||||
.from(d)
|
.on(a.learnId.eq(l.id))
|
||||||
.where(d.analUid.eq(mapSheetAnalInferenceEntity.id)))))
|
.where(
|
||||||
.from(mapSheetLearnEntity)
|
l.status
|
||||||
.leftJoin(mapSheetAnalInferenceEntity)
|
.eq(Status.END.getId())
|
||||||
.on(mapSheetAnalInferenceEntity.learnId.eq(mapSheetLearnEntity.id))
|
.and(JPAExpressions.selectOne().from(d).where(d.analUid.eq(a.id)).exists()))
|
||||||
.where(mapSheetLearnEntity.status.eq(Status.END.getId()))
|
.orderBy(l.id.asc())
|
||||||
.orderBy(mapSheetLearnEntity.id.asc())
|
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -305,8 +305,8 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
AuditLogDto.MenuDetail.class,
|
AuditLogDto.MenuDetail.class,
|
||||||
auditLogEntity.id.as("logId"),
|
auditLogEntity.id.as("logId"),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"to_char({0}, 'YYYY-MM-DD')", auditLogEntity.createdDate)
|
"to_char({0}, 'YYYY-MM-DD HH:mm')", auditLogEntity.createdDate)
|
||||||
.as("logDateTime"), // ??
|
.as("logDateTime"),
|
||||||
memberEntity.name.as("userName"),
|
memberEntity.name.as("userName"),
|
||||||
memberEntity.employeeNo.as("loginId"),
|
memberEntity.employeeNo.as("loginId"),
|
||||||
auditLogEntity.eventType.as("eventType"),
|
auditLogEntity.eventType.as("eventType"),
|
||||||
@@ -372,7 +372,7 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
AuditLogDto.UserDetail.class,
|
AuditLogDto.UserDetail.class,
|
||||||
auditLogEntity.id.as("logId"),
|
auditLogEntity.id.as("logId"),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"to_char({0}, 'YYYY-MM-DD')", auditLogEntity.createdDate)
|
"to_char({0}, 'YYYY-MM-DD HH:mm')", auditLogEntity.createdDate)
|
||||||
.as("logDateTime"),
|
.as("logDateTime"),
|
||||||
menuEntity.menuNm.as("menuName"),
|
menuEntity.menuNm.as("menuName"),
|
||||||
auditLogEntity.eventType.as("eventType"),
|
auditLogEntity.eventType.as("eventType"),
|
||||||
|
|||||||
Reference in New Issue
Block a user