package com.dbnt.faisp.main.userInfo.model;


import com.dbnt.faisp.config.BaseModel;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
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.LocalDate;
import java.time.LocalDateTime;



@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@IdClass(UserInfoHistory.UserInfoHistoryId.class)
@Table(name = "user_info_history")
public class UserInfoHistory extends BaseModel implements Serializable{
  @Id
  @Column(name = "user_seq")
  private Integer userSeq;
  @Id
  @Column(name = "version_no")
  private Integer versionNo;
  @Column(name = "dic_code")
  private String dicCode;
  @Column(name = "user_id")
  private String userId;
  @Column(name = "user_nm")
  private String userNm;
  @Column(name = "birth_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate birthDate;
  @Column(name = "sex")
  private String sex;
  @Column(name = "email")
  private String email;
  @Column(name = "phone_no")
  private String phoneNo;
  @Column(name = "area_cd")
  private String areaCd;
  @Column(name = "og_cd")
  private String ogCd;
  @Column(name = "ofc_cd")
  private String ofcCd;
  @Column(name = "title_cd")
  private String titleCd;
  @Column(name = "group_cd")
  private String groupCd;
  @Column(name = "series_cd")
  private String seriesCd;
  @Column(name = "ofc_head_yn")
  private String ofcHeadYn;
  @Column(name = "hiring_cd")
  private String hiringCd;
  @Column(name = "employ_cd")
  private String employCd;
  @Column(name = "outturn_cd")
  private String outturnCd;
  @Column(name = "work_cd")
  private String workCd;
  @Column(name = "job_in_cd")
  private String jobInCd;
  @Column(name = "language_cd")
  private String languageCd;
  @Column(name = "police_in_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate policeInDate;
  @Column(name = "organ_in_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate organInDate;
  @Column(name = "ofc_in_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate ofcInDate;
  @Column(name = "title_in_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate titleInDate;
  @Column(name = "user_status")
  private String userStatus;
  @Column(name = "wrt_organ")
  private String wrtOrgan;
  @Column(name = "wrt_part")
  private String wrtPart;
  @Column(name = "wrt_title")
  private String wrtTitle;
  @Column(name = "wrt_user_seq")
  private Integer wrtUserSeq;
  @Column(name = "wrt_nm")
  private String wrtNm;
  @Column(name = "wrt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
  private LocalDateTime wrtDt;



  

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class UserInfoHistoryId implements Serializable { 	
    private Integer userSeq; 
    private Integer versionNo;
  }
}
