package cn.estsh.i3plus.ext.mes.pcn.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.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @PROJECT_NAME: i3plus-mes-panasonic
 * @DESCRIPTION:
 * @USER: xinwang.yi
 * @DATE: 2022-06-26 10:32
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_KEY_PART_DATA", indexes = {
        @Index(columnList = "PRODUCT_SN"),
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "PRODUCT_SN, WORK_ORDER_NO")
})
@Api("条码绑定关键件信息数据记录表")
public class MesKeyPartData extends BaseBean implements Serializable {
    private static final long serialVersionUID = 3809878238166891492L;

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

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

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

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

    @Column(name = "FLAG")
    @ApiParam("读取标志位 0-正在绑定；1-已读；2-未读")
    public Integer flag;

    @Column(name = "KEY_DATA")
    @ApiParam("关键件数据")
    public String keyData;
}
