package cn.estsh.i3plus.pojo.mes.bean;


import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Description :包装规格
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PACK_SPEC")
@Api("包装规格")
public class MesPackSpec extends BaseBean implements Serializable {
    private static final long serialVersionUID = -5750996334546906547L;
    @Column(name = "SPEC_CODE")
    @ApiParam("包装规格代码")
    private String specCode;

    @Column(name = "SPEC_NAME")
    @ApiParam("包装规格名称")
    private String specName;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "包装数量", example = "0")
    private Double qty = 0d;

    @Column(name = "QTY2", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "包装数量2", example = "0")
    private Double qty2;

    @Column(name = "QTY3", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "包装数量3", example = "0")
    private Double qty3;

    @Column(name = "QTY4", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "包装数量4", example = "0")
    private Double qty4;

    @Column(name = "IS_MIXED")
    @ApiParam("是否混包")
    private Integer isMixed;

    @Column(name = "IS_MIXED2")
    @ApiParam("是否混包2")
    private Integer isMixed2;

    @Column(name = "IS_MIXED3")
    @ApiParam("是否混包3")
    private Integer isMixed3;

    @Column(name = "IS_MIXED4")
    @ApiParam("是否混包4")
    private Integer isMixed4;

    @Transient
    @ApiParam("是否混包名称")
    private String isMixedName;

    @Transient
    @ApiParam("是否混包2名称")
    private String isMixedName2;

    @Transient
    @ApiParam("是否混包3名称")
    private String isMixedName3;

    @Transient
    @ApiParam("是否混包4名称")
    private String isMixedName4;


    public double getQtyVal() {
        return this.qty == null ? 0.0d : this.qty;
    }

    public int getIsMixedVal() {
        return this.isMixed == null ? 0 : this.isMixed;
    }

    public int getIsMixed2Val() {
        return this.isMixed2 == null ? 0 : this.isMixed2;
    }

    public int getIsMixed3Val() {
        return this.isMixed3 == null ? 0 : this.isMixed3;
    }

    public int getIsMixed4Val() {
        return this.isMixed4 == null ? 0 : this.isMixed4;
    }

}
