package cn.estsh.i3plus.ext.mes.pojo.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.*;
import java.io.Serializable;

/**
 * @Author: wangjie
 * @CreateDate: 2019/7/30 9:30 AM
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_PRODUCE_SN_MC_RECORD", indexes = {
        @Index(columnList = "SYSTEM_SYNC_STATUS"),
        @Index(columnList = "MANAGE_CODE"),
        @Index(columnList = "MANAGE_CODE, SN_STATUS"),
        @Index(columnList = "WORK_ORDER_NO")
})
@Api("管理码与工单条码关系表")
public class MesProduceSnMcRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5513811974917633716L;

    @Column(name = "SYSTEM_SYNC_STATUS")
    @ColumnDefault("2")
    @ApiParam(value = "系统同步标志")
    public Integer systemSyncStatus = 2;

    @Column(name = "MANAGE_CODE")
    @ApiParam(value = "管理编码")
    private String manageCode;

    @Column(name = "SERIAL_NUMBER")
    @ApiParam("过程条码")
    private String serialNumber;

    @Column(name = "PRODUCT_SN")
    @ApiParam("产品条码")
    private String productSn;

    @Column(name = "PART_NO")
    @ApiParam("物料号")
    private String partNo;

    @Column(name = "PART_NAME_RDD")
    @ApiParam("物料名称")
    private String partNameRdd;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("生产线")
    private String workCenterCode;

    @Column(name = "WORK_ORDER_NO")
    @ApiParam("工单号")
    private String workOrderNo;

    @Column(name = "SN_STATUS")
    @ApiParam("条码状态")
    private Integer snStatus;

    @Column(name = "QC_STATUS")
    @ApiParam("质量状态")
    private Integer qcStatus;

    @Column(name = "OPERATE_TYPE")
    @ApiParam("操作类型")
    private Integer operateType;

    @Column(name = "LINE_ON_STATUS")
    @ApiParam("上线状态")
    private Integer lineOnStatus;

}
