sttc 엔티티 수정
This commit is contained in:
@@ -2,7 +2,6 @@ package com.kamco.cd.kamcoback.postgres.core;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Dashboard;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Dashboard;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalSttcEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultRepository;
|
||||||
import jakarta.persistence.EntityNotFoundException;
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -48,9 +47,10 @@ public class InferenceResultCoreService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<Dashboard> getInferenceResultDashboard(Long id) {
|
public List<Dashboard> getInferenceResultDashboard(Long id) {
|
||||||
return inferenceResultRepository.getInferenceResultDashboard(id).stream()
|
return null;
|
||||||
.map(MapSheetAnalSttcEntity::toDto)
|
// inferenceResultRepository.getInferenceResultDashboard(id).stream()
|
||||||
.toList();
|
// .map(MapSheetAnalSttcEntity::toDto)
|
||||||
|
// .toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,4 +63,9 @@ public class InferenceResultCoreService {
|
|||||||
InferenceResultDto.SearchGeoReq searchGeoReq) {
|
InferenceResultDto.SearchGeoReq searchGeoReq) {
|
||||||
return inferenceResultRepository.getInferenceGeomList(searchGeoReq);
|
return inferenceResultRepository.getInferenceGeomList(searchGeoReq);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// public List<Long> getSheets(
|
||||||
|
// return inferenceResultRepository.get
|
||||||
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.entity;
|
package com.kamco.cd.kamcoback.postgres.entity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.EmbeddedId;
|
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 java.time.ZonedDateTime;
|
import jakarta.validation.constraints.Size;
|
||||||
|
import java.time.OffsetDateTime;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
@@ -17,26 +17,29 @@ import org.hibernate.annotations.ColumnDefault;
|
|||||||
@Table(name = "tb_map_sheet_anal_sttc")
|
@Table(name = "tb_map_sheet_anal_sttc")
|
||||||
public class MapSheetAnalSttcEntity {
|
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", length = Integer.MAX_VALUE)
|
@Column(name = "updated_uid")
|
||||||
private Long updatedUid;
|
private Long updatedUid;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -47,26 +50,12 @@ public class MapSheetAnalSttcEntity {
|
|||||||
@Column(name = "data_uid", nullable = false)
|
@Column(name = "data_uid", nullable = false)
|
||||||
private Long dataUid;
|
private Long dataUid;
|
||||||
|
|
||||||
@Column(name = "class_before_cd")
|
@Size(max = 30)
|
||||||
|
@Column(name = "class_before_cd", length = 30)
|
||||||
private String classBeforeCd;
|
private String classBeforeCd;
|
||||||
|
|
||||||
@Column(name = "class_after_cd")
|
@Size(max = 30)
|
||||||
|
@Column(name = "class_after_cd", length = 30)
|
||||||
private String classAfterCd;
|
private String classAfterCd;
|
||||||
|
|
||||||
public InferenceResultDto.Dashboard toDto() {
|
|
||||||
return new InferenceResultDto.Dashboard(
|
|
||||||
id.getCompareYyyy(),
|
|
||||||
id.getTargetYyyy(),
|
|
||||||
id.getMapSheetNum(),
|
|
||||||
id.getClassBeforeName(),
|
|
||||||
id.getClassAfterName(),
|
|
||||||
this.classBeforeCnt,
|
|
||||||
this.classAfterCnt,
|
|
||||||
this.createdDttm,
|
|
||||||
this.createdUid,
|
|
||||||
this.updatedDttm,
|
|
||||||
this.updatedUid,
|
|
||||||
this.refMapSheetNum,
|
|
||||||
this.dataUid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ 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;
|
||||||
@@ -15,8 +14,7 @@ import org.hibernate.Hibernate;
|
|||||||
@Embeddable
|
@Embeddable
|
||||||
public class MapSheetAnalSttcEntityId implements Serializable {
|
public class MapSheetAnalSttcEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8630519290255405042L;
|
private static final long serialVersionUID = 2285491656408229553L;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "compare_yyyy", nullable = false)
|
@Column(name = "compare_yyyy", nullable = false)
|
||||||
private Integer compareYyyy;
|
private Integer compareYyyy;
|
||||||
@@ -29,16 +27,6 @@ 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;
|
||||||
|
|
||||||
@Size(max = 64)
|
|
||||||
@NotNull
|
|
||||||
@Column(name = "class_before_name", nullable = false, length = 64)
|
|
||||||
private String classBeforeName;
|
|
||||||
|
|
||||||
@Size(max = 64)
|
|
||||||
@NotNull
|
|
||||||
@Column(name = "class_after_name", nullable = false, length = 64)
|
|
||||||
private String classAfterName;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
@@ -48,15 +36,14 @@ public class MapSheetAnalSttcEntityId implements Serializable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
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.classBeforeName, entity.classBeforeName)
|
Objects.equals(this.compareYyyy, entity.compareYyyy) &&
|
||||||
&& Objects.equals(this.classAfterName, entity.classAfterName)
|
Objects.equals(this.mapSheetNum, entity.mapSheetNum);
|
||||||
&& Objects.equals(this.compareYyyy, entity.compareYyyy)
|
|
||||||
&& Objects.equals(this.mapSheetNum, entity.mapSheetNum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(targetYyyy, classBeforeName, classAfterName, compareYyyy, mapSheetNum);
|
return Objects.hash(targetYyyy, compareYyyy, mapSheetNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Optional;
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
|
||||||
public interface InferenceResultRepositoryCustom {
|
public interface InferenceResultRepositoryCustom {
|
||||||
|
|
||||||
Page<InferenceResultDto.AnalResList> getInferenceResultList(
|
Page<InferenceResultDto.AnalResList> getInferenceResultList(
|
||||||
InferenceResultDto.SearchReq searchReq);
|
InferenceResultDto.SearchReq searchReq);
|
||||||
|
|
||||||
@@ -15,4 +16,6 @@ public interface InferenceResultRepositoryCustom {
|
|||||||
List<MapSheetAnalSttcEntity> getInferenceResultDashboard(Long id);
|
List<MapSheetAnalSttcEntity> getInferenceResultDashboard(Long id);
|
||||||
|
|
||||||
Page<InferenceResultDto.Geom> getInferenceGeomList(InferenceResultDto.SearchGeoReq searchGeoReq);
|
Page<InferenceResultDto.Geom> getInferenceGeomList(InferenceResultDto.SearchGeoReq searchGeoReq);
|
||||||
|
|
||||||
|
List<Long> getSheets(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
|||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SearchGeoReq;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SearchGeoReq;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalSttcEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalSttcEntity;
|
||||||
|
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.QMapSheetAnalSttcEntity;
|
||||||
@@ -27,9 +28,10 @@ import org.springframework.stereotype.Repository;
|
|||||||
public class InferenceResultRepositoryImpl implements InferenceResultRepositoryCustom {
|
public class InferenceResultRepositoryImpl implements InferenceResultRepositoryCustom {
|
||||||
|
|
||||||
private final JPAQueryFactory queryFactory;
|
private final JPAQueryFactory queryFactory;
|
||||||
private final QMapSheetAnalEntity mapSheetAnal = QMapSheetAnalEntity.mapSheetAnalEntity;
|
|
||||||
private final QModelMngEntity tmm = QModelMngEntity.modelMngEntity;
|
private final QModelMngEntity tmm = QModelMngEntity.modelMngEntity;
|
||||||
private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity;
|
private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity;
|
||||||
|
private final QMapSheetAnalEntity mapSheetAnal = QMapSheetAnalEntity.mapSheetAnalEntity;
|
||||||
|
private final QMapSheetAnalDataEntity mapSheetAnalEntity = QMapSheetAnalDataEntity.mapSheetAnalDataEntity;
|
||||||
private final QMapSheetAnalSttcEntity mapSheetAnalSttc =
|
private final QMapSheetAnalSttcEntity mapSheetAnalSttc =
|
||||||
QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity;
|
QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity;
|
||||||
private final QMapSheetAnalDataGeomEntity mapSheetAnalDataGeom =
|
private final QMapSheetAnalDataGeomEntity mapSheetAnalDataGeom =
|
||||||
@@ -202,4 +204,22 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
|||||||
|
|
||||||
return new PageImpl<>(content, pageable, total);
|
return new PageImpl<>(content, pageable, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론된 5000:1 도엽 목록
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Long> getSheets(Long id) {
|
||||||
|
return queryFactory
|
||||||
|
.select(mapSheetAnalDataGeom.mapSheetNum)
|
||||||
|
.from(mapSheetAnal)
|
||||||
|
.join(mapSheetAnalEntity).on(mapSheetAnalEntity.analUid.eq(mapSheetAnal.id))
|
||||||
|
.join(mapSheetAnalDataGeom).on(mapSheetAnalDataGeom.dataUid.eq(mapSheetAnalEntity.id))
|
||||||
|
.where(mapSheetAnal.id.eq(id))
|
||||||
|
.groupBy(mapSheetAnalDataGeom.mapSheetNum)
|
||||||
|
.fetch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
ChangeDetectionDto.CountDto.class,
|
ChangeDetectionDto.CountDto.class,
|
||||||
mapSheetAnalSttcEntity.classAfterCd.toUpperCase(),
|
mapSheetAnalSttcEntity.classAfterCd.toUpperCase(),
|
||||||
mapSheetAnalSttcEntity.id.classAfterName,
|
null, // TOOD classAfterName 삭제해서 수정 필요
|
||||||
mapSheetAnalSttcEntity.classAfterCnt.sum()))
|
mapSheetAnalSttcEntity.classAfterCnt.sum()))
|
||||||
.from(mapSheetAnalEntity)
|
.from(mapSheetAnalEntity)
|
||||||
.innerJoin(mapSheetAnalDataEntity)
|
.innerJoin(mapSheetAnalDataEntity)
|
||||||
@@ -57,7 +57,7 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.innerJoin(mapSheetAnalSttcEntity)
|
.innerJoin(mapSheetAnalSttcEntity)
|
||||||
.on(mapSheetAnalSttcEntity.dataUid.eq(mapSheetAnalDataEntity.id))
|
.on(mapSheetAnalSttcEntity.dataUid.eq(mapSheetAnalDataEntity.id))
|
||||||
.where(mapSheetAnalEntity.id.eq(id))
|
.where(mapSheetAnalEntity.id.eq(id))
|
||||||
.groupBy(mapSheetAnalSttcEntity.classAfterCd, mapSheetAnalSttcEntity.id.classAfterName)
|
.groupBy(mapSheetAnalSttcEntity.classAfterCd)
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user