package com.dbnt.sims.equip.model;

import com.dbnt.sims.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 javax.persistence.*;

import java.io.Serializable;
import java.time.LocalDateTime;


@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@IdClass(Equip.EquipId.class)
@Table(name = "equ_mgt")
public class Equip extends BaseModel implements Serializable{
  @Id
  @Column(name = "equ_key")
  private Integer equKey;
  @Id
  @Column(name = "version_no")
  private Integer versionNo;
  @Column(name = "mgt_organ")
  private String mgtOrgan;
  @Column(name = "equ_type")
  private String equType;
  @Column(name = "detail_type")
  private String detailType;
  @Column(name = "stored_year")
  private String storedYear;
  @Column(name = "item_qty")
  private Integer itemQty;
  @Column(name = "item_condition")
  private String itemCondition;
  @Column(name = "note")
  private String note;
  @Column(name = "wrt_organ")
  private String wrtOrgan; 
  @Column(name = "wrt_nm")
  private String wrtNm;
  @Column(name = "wrt_dt")
  private LocalDateTime wrtDt;
  
  @Transient
  private String sosok;
  @Transient
  private String detailSosok;
  @Transient
  private String detailName;
  @Transient
  private String origNm;
  @Transient
  private String convNm;
  @Transient
  private String filePath;
  @Transient
  private Integer deleteFileKey;
  @Transient
  private Integer deleteFileVnum;
  @Transient
  private String noUpdateImg;
  
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class EquipId implements Serializable { 	
  private Integer equKey; 
  private Integer versionNo;
}

@Override
public String toString() {
	return "Equip [equKey=" + equKey + ", versionNo=" + versionNo + ", mgtOrgan=" + mgtOrgan + ", equType=" + equType
			+ ", detailType=" + detailType + ", storedYear=" + storedYear + ", itemQty=" + itemQty + ", itemCondition="
			+ itemCondition + ", note=" + note + ", wrtOrgan=" + wrtOrgan + ", wrtNm=" + wrtNm + ", wrtDt=" + wrtDt
			+ ", sosok=" + sosok + ", detailSosok=" + detailSosok + ", detailName=" + detailName + ", origNm=" + origNm
			+ ", convNm=" + convNm + ", filePath=" + filePath + ", deleteFileKey=" + deleteFileKey + ", deleteFileVnum="
			+ deleteFileVnum + ", noUpdateImg=" + noUpdateImg + "]";
}























}
