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.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;
import java.util.List;

/**
 * @Description:
 * @Reference:
 * @Author: joke.wang
 * @CreateDate: 2019\10\16 14:25
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_DEFECT")
@Api("缺陷表")
public class MesDefect extends BaseBean implements Serializable {

    private static final long serialVersionUID = -317846359848236696L;
    @Column(name = "DEFECT_CODE")
    @ApiParam("缺陷代码")
    private String defectCode;

    @Column(name = "DEFECT_NAME")
    @ApiParam("缺陷名称")
    private String defectName;

    @Column(name = "DEFECT_TYPE")
    @ApiParam("缺陷类型")
    private String defectType;

    @Column(name = "PROD_CFG_TYPE_CODE")
    @ApiParam("项目代码")
    private String prodCfgTypeCode;

    @Column(name = "DEFECT_ACTION_TYPE")
    @ApiParam("不良处理类型")
    private String defectActionType;

    @Column(name = "DEFECT_FLAG_VALUE")
    @ApiParam("缺陷标识值")
    private String defectFlagValue;

    @Transient
    @ApiParam("缺陷类型名称")
    private String defectTypeName;

    @Transient
    @ApiParam("缺陷位置")
    private String defectLocation;

    @Transient
    @ApiParam("颜色值")
    private String colorValue;

    @Transient
    @ApiParam("缺陷类型子集")
    private List<MesDefect> mesDefectList;

    public MesDefect() {

    }

    public MesDefect(String defectCode, String defectName, String defectType, String defectTypeName) {
        this.defectCode = defectCode;
        this.defectName = defectName;
        this.defectType = defectType;
        this.defectTypeName = defectTypeName;
    }

    public MesDefect(String defectType, String defectCode, String defectName) {
        this.defectType = defectType;
        this.defectCode = defectCode;
        this.defectName = defectName;
    }
}
