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;

/**
 * @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 {
    @Column(name="SPEC_CODE")
    @ApiParam("包装规格代码")
    private String specCode;

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

    @Column(name="PARENT_SPEC")
    @ApiParam("父包装规格代码")
    private String parentSpec;

    @Column(name = "QTY")
    @ColumnDefault("0")
    @ApiParam(value = "数量", example = "0")
    private Double qty;

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

    @Column(name="SPEC_LEVEL")
    @ApiParam("规格级别")
    private Integer specLevel;

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

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

    public int getSpecLevelVal() {
        return this.specLevel == null ? 0 : this.specLevel;
    }
}
