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_ERROR_LINE_OFF_DETAIL", indexes = {
        @Index(columnList = "PID"),
        @Index(columnList = "SERIAL_NUMBER, WORK_ORDER_NO")
})
@Api("异常下线明细表")
public class MesErrorLineOffDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = -3391939361743894473L;

    @Column(name = "PID")
    @ApiParam("异常下线ID")
    public Long pid;

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

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

    @Column(name = "ITEM_PART_NO")
    @ApiParam("原材料物料编码")
    private String itemPartNo;

    @Column(name = "ITEM_PART_NAME")
    @ApiParam("原材料物料名称")
    private String itemPartName;

    @Column(
            name = "QTY",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam(value = "原材料物料数量", example = "0")
    private Double qty;

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

}
