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

import java.util.Date;
import java.util.List;

import com.sw.mes.production.dto.BarrelShaped;
import com.sw.mes.production.dto.TypeFormulaDto;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

/**
* @Author
* @Description：
* @Date: Create in
* @Modified By:
*/
@Data
@Entity
@Table(name="production_formula_scheme")
@DynamicUpdate
@DynamicInsert
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class FormulaScheme{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
	/**
	 * 配方名称
	 */
    @Column(length=50)
    private String name;
    
	/**
	 * 配方编码
	 */
    @Column(length=50)
    private String code;
    
	/**
	 * 版本号
	 */
    @Column(length=10)
    private Integer version;
    
	/**
	 * 配方用途
	 */
    @Column(name = "`use`",length=200)
    private String use;
    
	/**
	 * 状态（0：失效；1：生效)
	 */
    @Column(length=0)
    private Boolean status;
    
	/**
	 * 验证状态（0：验证失败，1：验证失败)
	 */
    @Column(length=0)
    private Boolean validating;

	/**
	 * 投料种类方案
	 */
	@Type(type = "json")
	@Column(nullable = false, length = 0, columnDefinition = "json")
    private List<TypeFormulaDto> typeFormula;


	/**
	 * 投入桶型
	 */
	@Type(type = "json")
	@Column(nullable = false, length = 0, columnDefinition = "json")
    private List<BarrelShaped> barrelShaped;
    
	/**
	 * 创建人
	 */
    @Column(nullable=false, length=20)
    private String userCreate;
    
	/**
	 * 创建时间
	 */
    @Column(nullable=false, length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date gmtCreate;
    
	/**
	 * 修改人
	 */
    @Column(length=20)
    private String userUpdate;
    
	/**
	 * 修改时间
	 */
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date gmtUpdate;
    

	public FormulaScheme() {
	}

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