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

import com.sw.mes.production.dto.WeightScheme;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import io.swagger.models.auth.In;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

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

/**
 * @Author
 * @Description：
 * @Date: Create in
 * @Modified By:
 */
@Data
@Entity
@Table(name = "production_formula_weight_scheme")
@DynamicUpdate
@DynamicInsert
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class FormulaWeightScheme {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 方案名称
     */
    @Column(nullable = false, length = 50)
    private String name;

    /**
     * 满锅重量
     */
    @Column(nullable = false, length = 18)
    private BigDecimal fullPotWeight;

    /**
     * 复投满锅重量
     */
    @Column(nullable = false, length = 18)
    private BigDecimal rechargeFullPotWeight;

    /**
     * 初装重量
     */
    @Column(nullable = false, length = 18)
    private BigDecimal initialWeight;

    /**
     * 报料范围上限
     */
    @Column(nullable = false, length = 18)
    private BigDecimal scopeUpper;

    /**
     * 报料范围下限
     */
    @Column(nullable = false, length = 18)
    private BigDecimal scopeLower;

    /**
     * 桶规格
     */
    @Column(nullable = false, length = 18)
    private BigDecimal barrelSpecs;

    /**
     * 重量方案
     */
    @Type(type = "json")
    @Column(nullable = false, length = 0, columnDefinition = "json")
    private List<WeightScheme> weightScheme;

    /**
     * 创建人
     */
    @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;

    /**
     * 复投满锅重量
     */
    @Type(type = "json")
    @Column(columnDefinition = "json")
    private Map<String, BigDecimal> againFullPotWeight;

    /**
     * 初装满锅重量
     */
    @Column(length = 18)
    private BigDecimal initFullPotWeight;


    public FormulaWeightScheme() {
    }

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