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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sw.mes.base.factory.init.entity.MachineCapacityKfinfo;
import com.sw.mes.base.factory.product.entity.FbProductModel;
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="plan_fb_production_schedule")
@DynamicUpdate
@DynamicInsert
public class FbProductionSchedule {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

	/**
	 * 晶段id
	 */
    @Column(length=10)
    private Integer sectionId;

	/**
	 * 晶段编号
	 */
    @Column(length=32)
    private String sectionNo;

	/**
	 * 工单编号
	 */
    @Column(length=32)
    private String code;

	/**
	 * 设备id
	 */
    @Column(length=10)
    private Integer deviceId;

	/**
	 * 设备编号
	 */
    @Column(length=32)
    private String deviceNo;


    /**
     * 产品信息
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "fb_product_model_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private FbProductModel fbProductModel;

    /**
     * 订单信息
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "fb_production_order_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private FbProductionOrder productionOrder;

	/**
	 * 任务状态(0：即将开始,1：进行中,2：已完成,3：已取消)
	 */
    @Column(nullable=false, length=0)
    private Integer status;

	/**
	 * 状态信息
	 */
    @Column(length=200)
    private String statusInfo;

	/**
	 * 创建时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date createTime;

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

    /**
     * 创建人id
     */
    @Column(length = 10)
    private Integer createUserId;

    /**
     * 创建人
     */
    @Column(length = 32)
    private String createUserName;

    /**
     * 设备类别
     */
    @Column(length = 32)
    private Integer category;

    /**
     * 设备加工能力
     */
    @Column(length = 10)
    private Integer capacityId;

	public FbProductionSchedule() {
	}

	public FbProductionSchedule(Integer id) {
		this.id = id;
	}
}
