Merge branch 'develop' into feat/dev_251201
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheet;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
@@ -10,6 +18,7 @@ import org.locationtech.jts.geom.Geometry;
|
||||
@Table(name = "tb_map_inkx_5k")
|
||||
@Entity
|
||||
public class MapInkx5kEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_map_inkx_5k_fid_seq_gen")
|
||||
@SequenceGenerator(
|
||||
@@ -29,4 +38,8 @@ public class MapInkx5kEntity {
|
||||
|
||||
@Column(name = "fid_k50")
|
||||
private Long fidK50;
|
||||
|
||||
public InferenceResultDto.MapSheet toEntity() {
|
||||
return new MapSheet(mapidcdNo, mapidNm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Clazzes;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
@@ -31,6 +38,9 @@ public class MapSheetAnalDataGeomEntity {
|
||||
@Column(name = "geo_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "uuid")
|
||||
private UUID uuid;
|
||||
|
||||
@Column(name = "cd_prob")
|
||||
private Double cdProb;
|
||||
|
||||
@@ -51,6 +61,10 @@ public class MapSheetAnalDataGeomEntity {
|
||||
@Column(name = "map_sheet_num")
|
||||
private Long mapSheetNum;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "map_5k_id", referencedColumnName = "fid")
|
||||
private MapInkx5kEntity map5k;
|
||||
|
||||
@Column(name = "compare_yyyy")
|
||||
private Integer compareYyyy;
|
||||
|
||||
@@ -133,4 +147,21 @@ public class MapSheetAnalDataGeomEntity {
|
||||
|
||||
@Column(name = "geom_center", columnDefinition = "geometry")
|
||||
private Geometry geomCenter;
|
||||
|
||||
public InferenceResultDto.DetailListEntity toEntity() {
|
||||
DetectionClassification classification = DetectionClassification.fromString(classBeforeCd);
|
||||
Clazzes comparedClazz = new Clazzes(classification, classBeforeProb);
|
||||
DetectionClassification classification1 = DetectionClassification.fromString(classAfterCd);
|
||||
Clazzes targetClazz = new Clazzes(classification1, classAfterProb);
|
||||
InferenceResultDto.MapSheet mapSheet = map5k != null ? map5k.toEntity() : null;
|
||||
|
||||
InferenceResultDto.Coordinate coordinate = null;
|
||||
if (geomCenter != null) {
|
||||
org.locationtech.jts.geom.Point point = (org.locationtech.jts.geom.Point) geomCenter;
|
||||
coordinate = new InferenceResultDto.Coordinate(point.getX(), point.getY());
|
||||
}
|
||||
|
||||
return new InferenceResultDto.DetailListEntity(
|
||||
uuid, cdProb, comparedClazz, targetClazz, mapSheet, coordinate, createdDttm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@@ -17,6 +19,9 @@ import org.hibernate.annotations.ColumnDefault;
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_map_sheet_anal")
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
// TODO SETTER 제거
|
||||
// TODO 주석
|
||||
public class MapSheetAnalEntity {
|
||||
|
||||
@Id
|
||||
@@ -28,21 +33,24 @@ public class MapSheetAnalEntity {
|
||||
@Column(name = "anal_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
// TODO UUID
|
||||
// UK 추가
|
||||
|
||||
@Column(name = "compare_yyyy")
|
||||
private Integer compareYyyy;
|
||||
private Integer compareYyyy; // 비교년도
|
||||
|
||||
@Column(name = "target_yyyy")
|
||||
private Integer targetYyyy;
|
||||
private Integer targetYyyy; // 기분년도
|
||||
|
||||
@Column(name = "model_uid")
|
||||
private Long modelUid;
|
||||
private Long modelUid; // 모델식별키 ?
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "server_ids", length = 100)
|
||||
private String serverIds;
|
||||
private String serverIds; // 서버ID?
|
||||
|
||||
@Column(name = "anal_map_sheet", length = Integer.MAX_VALUE)
|
||||
private String analMapSheet;
|
||||
private String analMapSheet; // 분석도엽?
|
||||
|
||||
@Column(name = "anal_strt_dttm")
|
||||
private ZonedDateTime analStrtDttm;
|
||||
@@ -54,15 +62,15 @@ public class MapSheetAnalEntity {
|
||||
private Long analSec;
|
||||
|
||||
@Column(name = "anal_pred_sec")
|
||||
private Long analPredSec;
|
||||
private Long analPredSec; // 예상소요초?
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "anal_state", length = 20)
|
||||
private String analState;
|
||||
private String analState; // enum 으로 관리
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "gukyuin_used", length = 20)
|
||||
private String gukyuinUsed;
|
||||
private String gukyuinUsed; // Boolean으로 관리
|
||||
|
||||
@Column(name = "accuracy")
|
||||
private Double accuracy;
|
||||
@@ -71,17 +79,9 @@ public class MapSheetAnalEntity {
|
||||
@Column(name = "result_url")
|
||||
private String resultUrl;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "created_dttm")
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@Column(name = "created_uid")
|
||||
private Long createdUid;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "updated_dttm")
|
||||
private ZonedDateTime updatedDttm;
|
||||
|
||||
@Column(name = "updated_uid")
|
||||
private Long updatedUid;
|
||||
|
||||
@@ -94,4 +94,13 @@ public class MapSheetAnalEntity {
|
||||
|
||||
@Column(name = "base_map_sheet_num")
|
||||
private String baseMapSheetNum;
|
||||
|
||||
// TODO CommonDateEntity ?
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "created_dttm")
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "updated_dttm")
|
||||
private ZonedDateTime updatedDttm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user