package cn.estsh.i3plus.pojo.mes.pcn.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.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_PROD_CFG_DETAIL")
@Api("产品配置明细")
public class MesProdCfgDetail extends BaseBean implements Serializable {
    private static final long serialVersionUID = -8362302529703401583L;
    @Column(name = "PROD_CFG_CODE")
    @ApiParam("产品配置代码")
    private String prodCfgCode;

    @Column(name = "PART_NO")
    @ApiParam("零件号")
    private String partNo;

    @Column(name = "IS_VIRTUAL")
    @ApiParam("是否虚零件")
    private Integer isVirtual;

    @Transient
    @ApiParam("零件名称")
    private String partName;

    public int getIsVirtualVal() {
        return this.isVirtual == null ? 0 : this.isVirtual;
    }
}
