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