분석결과 상세 수정
This commit is contained in:
@@ -148,11 +148,13 @@ public class InferenceResultDto {
|
|||||||
@Getter
|
@Getter
|
||||||
public static class Dashboard {
|
public static class Dashboard {
|
||||||
|
|
||||||
|
String classAfterCd;
|
||||||
String classAfterName;
|
String classAfterName;
|
||||||
Long classAfterCnt;
|
Long classAfterCnt;
|
||||||
|
|
||||||
public Dashboard(String classAfterName, Long classAfterCnt) {
|
public Dashboard(String classAfterCd, Long classAfterCnt) {
|
||||||
this.classAfterName = classAfterName;
|
this.classAfterCd = classAfterCd;
|
||||||
|
this.classAfterName = DetectionClassification.fromString(classAfterCd).getDesc();
|
||||||
this.classAfterCnt = classAfterCnt;
|
this.classAfterCnt = classAfterCnt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import jakarta.persistence.EmbeddedId;
|
|||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import java.time.OffsetDateTime;
|
||||||
import java.time.ZonedDateTime;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
@@ -19,24 +18,22 @@ public class MapSheetAnalSttcEntity {
|
|||||||
|
|
||||||
@EmbeddedId private MapSheetAnalSttcEntityId id;
|
@EmbeddedId private MapSheetAnalSttcEntityId id;
|
||||||
|
|
||||||
@ColumnDefault("0")
|
|
||||||
@Column(name = "class_before_cnt")
|
@Column(name = "class_before_cnt")
|
||||||
private Long classBeforeCnt;
|
private Long classBeforeCnt;
|
||||||
|
|
||||||
@ColumnDefault("0")
|
|
||||||
@Column(name = "class_after_cnt")
|
@Column(name = "class_after_cnt")
|
||||||
private Long classAfterCnt;
|
private Long classAfterCnt;
|
||||||
|
|
||||||
@ColumnDefault("now()")
|
@ColumnDefault("now()")
|
||||||
@Column(name = "created_dttm")
|
@Column(name = "created_dttm")
|
||||||
private ZonedDateTime createdDttm;
|
private OffsetDateTime createdDttm;
|
||||||
|
|
||||||
@Column(name = "created_uid")
|
@Column(name = "created_uid")
|
||||||
private Long createdUid;
|
private Long createdUid;
|
||||||
|
|
||||||
@ColumnDefault("now()")
|
@ColumnDefault("now()")
|
||||||
@Column(name = "updated_dttm")
|
@Column(name = "updated_dttm")
|
||||||
private ZonedDateTime updatedDttm;
|
private OffsetDateTime updatedDttm;
|
||||||
|
|
||||||
@Column(name = "updated_uid")
|
@Column(name = "updated_uid")
|
||||||
private Long updatedUid;
|
private Long updatedUid;
|
||||||
@@ -45,15 +42,6 @@ public class MapSheetAnalSttcEntity {
|
|||||||
@Column(name = "ref_map_sheet_num", nullable = false)
|
@Column(name = "ref_map_sheet_num", nullable = false)
|
||||||
private Long refMapSheetNum;
|
private Long refMapSheetNum;
|
||||||
|
|
||||||
@NotNull
|
@Column(name = "class_after_prob_avg")
|
||||||
@Column(name = "data_uid", nullable = false)
|
private Double classAfterProbAvg;
|
||||||
private Long dataUid;
|
|
||||||
|
|
||||||
@Size(max = 30)
|
|
||||||
@Column(name = "class_before_cd", length = 30)
|
|
||||||
private String classBeforeCd;
|
|
||||||
|
|
||||||
@Size(max = 30)
|
|
||||||
@Column(name = "class_after_cd", length = 30)
|
|
||||||
private String classAfterCd;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,18 +3,20 @@ package com.kamco.cd.kamcoback.postgres.entity;
|
|||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Embeddable;
|
import jakarta.persistence.Embeddable;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Embeddable
|
@Embeddable
|
||||||
public class MapSheetAnalSttcEntityId implements Serializable {
|
public class MapSheetAnalSttcEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2285491656408229553L;
|
private static final long serialVersionUID = 3649782418773406961L;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "compare_yyyy", nullable = false)
|
@Column(name = "compare_yyyy", nullable = false)
|
||||||
@@ -28,6 +30,25 @@ public class MapSheetAnalSttcEntityId implements Serializable {
|
|||||||
@Column(name = "map_sheet_num", nullable = false)
|
@Column(name = "map_sheet_num", nullable = false)
|
||||||
private Long mapSheetNum;
|
private Long mapSheetNum;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "data_uid", nullable = false)
|
||||||
|
private Long dataUid;
|
||||||
|
|
||||||
|
@Size(max = 30)
|
||||||
|
@NotNull
|
||||||
|
@ColumnDefault("NULL")
|
||||||
|
@Column(name = "class_before_cd", nullable = false, length = 30)
|
||||||
|
private String classBeforeCd;
|
||||||
|
|
||||||
|
@Size(max = 30)
|
||||||
|
@NotNull
|
||||||
|
@ColumnDefault("NULL")
|
||||||
|
@Column(name = "class_after_cd", nullable = false, length = 30)
|
||||||
|
private String classAfterCd;
|
||||||
|
|
||||||
|
@Column(name = "anal_uid")
|
||||||
|
private Long analUid;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
@@ -38,12 +59,17 @@ public class MapSheetAnalSttcEntityId implements Serializable {
|
|||||||
}
|
}
|
||||||
MapSheetAnalSttcEntityId entity = (MapSheetAnalSttcEntityId) o;
|
MapSheetAnalSttcEntityId entity = (MapSheetAnalSttcEntityId) o;
|
||||||
return Objects.equals(this.targetYyyy, entity.targetYyyy)
|
return Objects.equals(this.targetYyyy, entity.targetYyyy)
|
||||||
|
&& Objects.equals(this.analUid, entity.analUid)
|
||||||
|
&& Objects.equals(this.dataUid, entity.dataUid)
|
||||||
|
&& Objects.equals(this.classAfterCd, entity.classAfterCd)
|
||||||
&& Objects.equals(this.compareYyyy, entity.compareYyyy)
|
&& Objects.equals(this.compareYyyy, entity.compareYyyy)
|
||||||
|
&& Objects.equals(this.classBeforeCd, entity.classBeforeCd)
|
||||||
&& Objects.equals(this.mapSheetNum, entity.mapSheetNum);
|
&& Objects.equals(this.mapSheetNum, entity.mapSheetNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(targetYyyy, compareYyyy, mapSheetNum);
|
return Objects.hash(
|
||||||
|
targetYyyy, analUid, dataUid, classAfterCd, compareYyyy, classBeforeCd, mapSheetNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SearchGeoReq;
|
|||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataGeomEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalEntity;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalSttcEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QModelVerEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QModelVerEntity;
|
||||||
import com.querydsl.core.BooleanBuilder;
|
import com.querydsl.core.BooleanBuilder;
|
||||||
@@ -34,6 +35,8 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
|||||||
QMapSheetAnalDataEntity.mapSheetAnalDataEntity;
|
QMapSheetAnalDataEntity.mapSheetAnalDataEntity;
|
||||||
private final QMapSheetAnalDataGeomEntity mapSheetAnalDataGeomEntity =
|
private final QMapSheetAnalDataGeomEntity mapSheetAnalDataGeomEntity =
|
||||||
QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity;
|
QMapSheetAnalDataGeomEntity.mapSheetAnalDataGeomEntity;
|
||||||
|
private final QMapSheetAnalSttcEntity mapSheetAnalSttcEntity =
|
||||||
|
QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 분석결과 목록 조회
|
* 분석결과 목록 조회
|
||||||
@@ -143,7 +146,16 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Dashboard> getDashboard(Long id) {
|
public List<Dashboard> getDashboard(Long id) {
|
||||||
return null;
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
Dashboard.class,
|
||||||
|
mapSheetAnalSttcEntity.id.classAfterCd,
|
||||||
|
mapSheetAnalSttcEntity.classAfterCnt.sum()))
|
||||||
|
.from(mapSheetAnalSttcEntity)
|
||||||
|
.where(mapSheetAnalSttcEntity.id.analUid.eq(id))
|
||||||
|
.groupBy(mapSheetAnalSttcEntity.id.classAfterCd)
|
||||||
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,16 +48,16 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
ChangeDetectionDto.CountDto.class,
|
ChangeDetectionDto.CountDto.class,
|
||||||
mapSheetAnalSttcEntity.classAfterCd.toUpperCase(),
|
mapSheetAnalSttcEntity.id.classAfterCd.toUpperCase(),
|
||||||
null, // TOOD classAfterName 삭제해서 수정 필요
|
null, // TOOD classAfterName 삭제해서 수정 필요
|
||||||
mapSheetAnalSttcEntity.classAfterCnt.sum()))
|
mapSheetAnalSttcEntity.classAfterCnt.sum()))
|
||||||
.from(mapSheetAnalEntity)
|
.from(mapSheetAnalEntity)
|
||||||
.innerJoin(mapSheetAnalDataEntity)
|
.innerJoin(mapSheetAnalDataEntity)
|
||||||
.on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id))
|
.on(mapSheetAnalDataEntity.analUid.eq(mapSheetAnalEntity.id))
|
||||||
.innerJoin(mapSheetAnalSttcEntity)
|
.innerJoin(mapSheetAnalSttcEntity)
|
||||||
.on(mapSheetAnalSttcEntity.dataUid.eq(mapSheetAnalDataEntity.id))
|
.on(mapSheetAnalSttcEntity.id.dataUid.eq(mapSheetAnalDataEntity.id))
|
||||||
.where(mapSheetAnalEntity.id.eq(id))
|
.where(mapSheetAnalEntity.id.eq(id))
|
||||||
.groupBy(mapSheetAnalSttcEntity.classAfterCd)
|
.groupBy(mapSheetAnalSttcEntity.id.classAfterCd)
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user