/**
 * There are <a href="https://github.com/ketayao/keta-custom">keta-custom</a> code generation
 */
package com.sw.mes.yb.accessory.entity;

import com.sw.mes.base.factory.init.entity.Equipment;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
* @Author
* @Description：
* @Date: Create in
* @Modified By:
*/
@Data
@Entity
@Table(name="accessory_discard")
@DynamicUpdate
@DynamicInsert
public class AccessoryDiscard{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "accessory_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private EquipmentAccessory accessory;

    /**
     * 辅料信息
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "material_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private AccessoryMaterial material;

    /**
     * 设备
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "equipment_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Equipment equipment;

    /**
     * 退库记录
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "return_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private AccessoryReturn accessoryReturn;

	/**
	 * 热场条码
	 */
    @Column(length=50)
    private String goodsCode;
    
	/**
	 * 厂家
	 */
    @Column(length=50)
    private String factory;

    /**
     * 实际使用寿命
     */
    @Column
    BigDecimal useTime;

    /**
     * 辅料更换时间
     */
    @Column
    Date operateTime;
    
	/**
	 * 退库类型
	 */
    @Column(length=20)
    private String returnType;
    
	/**
	 * 状态。。。(暂废弃)
	 */
    @Column(length=20)
    private String status;
    
	/**
	 * 评审结果 (评审中、待评审、评审完毕)
	 */
    @Column(length=20)
    private String result;
    
	/**
	 * 生产意见
	 */
    @Column(length=20)
    private String opinionOfProduct;
    
	/**
	 * 生产备注
	 */
    @Column(length=255)
    private String remarkOfProduct;
    
	/**
	 * 生产评审时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date timeOfProduct;
    
	/**
	 * 技术意见
	 */
    @Column(length=20)
    private String opinionOfTechnology;
    
	/**
	 * 技术备注
	 */
    @Column(length=255)
    private String remarkOfTechnology;
    
	/**
	 * 技术评审时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date timeOfTechnology;
    
	/**
	 * 质量意见
	 */
    @Column(length=20)
    private String opinionOfQuality;
    
	/**
	 * 质量备注
	 */
    @Column(length=255)
    private String remarkOfQuality;
    
	/**
	 * 质量评审时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date timeOfQuality;

    /**
	 * 创建时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
    
	/**
	 * 创建人
	 */
    @Column(length=50)
    private String createUser;
    
	/**
	 * 创建人工号
	 */
    @Column(length=20)
    private Integer createId;
    
	/**
	 * 修改人时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;
    
	/**
	 * 修改人
	 */
    @Column(length=50)
    private String updateUser;
    
	/**
	 * 修改人工号
	 */
    @Column(length=20)
    private Integer updateId;
    

	public AccessoryDiscard() {
	}

	public AccessoryDiscard(Long id) {
		this.id = id;
	}
}
