package com.kamco.cd.kamcoback.postgres.entity;

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 jakarta.validation.constraints.Size;
import java.time.ZonedDateTime;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

@Getter
@Setter
@Entity
@Table(name = "tb_map_sheet_anal")
public class MapSheetAnalEntity {

  @Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_map_sheet_anal_id_gen")
  @SequenceGenerator(
      name = "tb_map_sheet_anal_id_gen",
      sequenceName = "tb_map_sheet_anal_anal_uid",
      allocationSize = 1)
  @Column(name = "anal_uid", nullable = false)
  private Long id;

  @Column(name = "compare_yyyy")
  private Integer compareYyyy;

  @Column(name = "target_yyyy")
  private Integer targetYyyy;

  @Column(name = "model_uid")
  private Long modelUid;

  @Size(max = 100)
  @Column(name = "server_ids", length = 100)
  private String serverIds;

  @Column(name = "anal_map_sheet", length = Integer.MAX_VALUE)
  private String analMapSheet;

  @Column(name = "anal_strt_dttm")
  private ZonedDateTime analStrtDttm;

  @Column(name = "anal_end_dttm")
  private ZonedDateTime analEndDttm;

  @Column(name = "anal_sec")
  private Long analSec;

  @Column(name = "anal_pred_sec")
  private Long analPredSec;

  @Size(max = 20)
  @Column(name = "anal_state", length = 20)
  private String analState;

  @Size(max = 20)
  @Column(name = "gukyuin_used", length = 20)
  private String gukyuinUsed;

  @Column(name = "accuracy")
  private Double accuracy;

  @Size(max = 255)
  @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;

  @Size(max = 255)
  @Column(name = "anal_title")
  private String analTitle;

  @Column(name = "detecting_cnt")
  private Long detectingCnt;

  @Column(name = "base_map_sheet_num")
  private String baseMapSheetNum;
}
