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

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
* @Author
* @Description：
* @Date: Create in
* @Modified By:
*/
@Data
@Entity
@Table(name="production_formula_product_scheme_weight_detail")
@DynamicUpdate
@DynamicInsert
public class FormulaProductSchemeWeightDetail{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
	/**
	 * 产品配方ID
	 */
	@ApiModelProperty(value = "产品配方ID" , required = true)
    @Column(nullable=false, length=19)
    private Long formulaProductSchemeId;
    
	/**
	 * 重量方案ID
	 */
	@ApiModelProperty(value = "重量方案ID" , required = true)
    @Column(nullable=false, length=19)
    private Long weightSchemeId;
    
	/**
	 * 重量方案名称
	 */
	@ApiModelProperty(value = "重量方案名称" , required = true)
    @Column(nullable=false, length=50)
    private String weightSchemeName;
    
	/**
	 * 报料范围上限
	 */
	@ApiModelProperty(value = "报料范围上限" , required = true)
    @Column(nullable=false, length=18)
    private BigDecimal scopeUpper;
    
	/**
	 * 报料范围下限
	 */
	@ApiModelProperty(value = "报料范围下限" , required = true)
    @Column(nullable=false, length=18)
    private BigDecimal scopeLower;
    
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间" )
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
    
	/**
	 * 状态(0:异常, 1:正常)
	 */
	@ApiModelProperty(value = "状态(0:异常, 1:正常)" )
    @Column(length=10)
    private Integer status;


	@ApiModelProperty(value = "重量及配方方案明细")
	@Transient
	private List<FormulaProductSchemeDetail> schemeDetailList;
    

	public FormulaProductSchemeWeightDetail() {
	}

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