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

/**
 * @Description:
 * @Reference:
 * @Author: joke.wang
 * @CreateDate: 2019\10\12 14:46
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_QC_CHECK_STANDARD")
@Api("质量检测标准")
public class MesQcCheckStandard extends BaseBean implements Serializable {

    private static final long serialVersionUID = 1590320231495124712L;
    @Column(name = "PART_NO")
    @ApiParam("物料编码")
    private String partNo;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心代码")
    private String workCenterCode;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工作单元代码")
    private String workCellCode;

    @Column(name = "CHECK_TYPE")
    @ApiParam("检测类型")
    private Integer checkType;

    @Column(name = "CHECK_ITEM")
    @ApiParam("检测项")
    private String checkItem;

    @Column(name = "CHECK_STANDARD")
    @ApiParam("检测标准")
    private String checkStandard;

    @Column(name = "CHECK_GUIDE")
    @ApiParam("检测指导")
    private String checkGuide;

    @Column(name = "CHECK_FREQUENCY")
    @ApiParam("频率")
    private String checkFrequency;

    @Transient
    @ApiParam("物料名称")
    private String partName;

    @Transient
    @ApiParam("检测结果")
    private String checkResult;

    @Transient
    @ApiParam("检测值")
    private String checkValue;

    @Column(name = "CHECK_ITEM_TYPE")
    @ApiParam("检测项类型")
    private String checkItemType;

    @Transient
    @ApiParam("检测项类型名称")
    private String checkItemTypeName;

    @Transient
    private List<MesQcCheckStandard> childQcList;

    public MesQcCheckStandard() {
    }

    public MesQcCheckStandard(Long id, String partNo, String workCenterCode, String workCellCode, Integer checkType, String checkItem, String checkStandard
            , String checkGuide, String checkFrequency, String partName, String checkItemType, String checkItemTypeName) {
        this.id = id;
        this.partNo = partNo;
        this.workCenterCode = workCenterCode;
        this.workCellCode = workCellCode;
        this.checkType = checkType;
        this.checkItem = checkItem;
        this.checkStandard = checkStandard;
        this.checkGuide = checkGuide;
        this.checkFrequency = checkFrequency;
        this.partName = partName;
        this.checkItemType = checkItemType;
        this.checkItemTypeName = checkItemTypeName;
    }
}
