package com.dbnt.kcscbackend.commonCode.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_cmt_org")
public class TnCmtOrg {

  @Id
  @Column(name = "cmt_seq")
  private Long cmtSeq;

  @Column(name = "cmt_nm")
  private String cmtNm;

  @Column(name = "cmt_type")
  private String cmtType;

  @Column(name = "cmt_desc")
  private String cmtDesc;

  @Column(name = "up_cmt_seq")
  private Long upCmtSeq;

  @Column(name = "cmt_order")
  private Integer cmtOrder;

  @Column(name = "frst_crt_id")
  private String frstCrtId;

  @Column(name = "frst_crt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime frstCrtDt;

  @Column(name = "last_chg_id")
  private String lastChgId;

  @Column(name = "last_chg_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime lastChgDt;

  @Column(name = "use_yn")
  private String useYn;

  @Column(name = "old_seq")
  private Long oldSeq;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class TnCmtOrgId implements Serializable {
    private String cmtSeq;
  }

}