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

import com.sw.mes.base.factory.init.entity.Equipment;
import com.sw.mes.base.factory.product.entity.FbAccessoryMaterial;
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.util.Date;

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

    /**
     * 更新时间
     */
    @Column(length=19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateDate;

	/**
	 * 更换时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date operateDate;

	/**
	 * 更换人
	 */
    @Column(length=50)
    private String operateUser;

	/**
	 * 更换人ID
	 */
    @Column(length=10)
    private Integer operateUserId;

	/**
	 * 使用时间
	 */
    @Column(length=22)
    private Double useTime;


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

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

	/**
	 * 物品编码
	 */
    @Column(length=255)
    private String goodsCode;

	/**
	 * 厂家
	 */
    @Column(length=255)
    private String factory;

	/**
	 * 是否删除（已删除1，没有0）
	 */
    @Column(length=10)
    private Integer deleted;

	/**
	 * 数量
	 */
    @Column(length=10)
    private Integer num;

    /**
     * 设备位置
     */
    @Column
    private String deviceSeat;


	public FbEquipmentAccessory() {
	}

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