package cn.estsh.i3plus.pojo.mes.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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;
import java.util.List;

/**
 * @Description : 工站队列
 * @Reference :
 * @Author : dragon.xu
 * @CreateDate : 2019-05-22 17:58
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_WORK_CELL_POINT", indexes = {
        @Index(columnList = "ORGANIZE_CODE"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "WORK_CELL_CODE"),
        @Index(columnList = "QUEUE_SEQ"),
        @Index(columnList = "QUEUE_DETAIL_SEQ")
})
@Api("工站队列")
public class MesWorkCellPoint extends BaseBean implements Serializable {

    private static final long serialVersionUID = -6817903235638554748L;
    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心")
    private String workCenterCode;

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

    @Column(name = "QUEUE_SEQ", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("队列主表序号")
    private Double queueSeq;

    @Column(name = "QUEUE_DETAIL_SEQ", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("队列明细表序号")
    private Double queueDetailSeq;

    @Column(name = "VIN_CODE")
    @ApiParam("Vin")
    private String vinCode;

    public double getQueueSeqVal() {
        return this.queueSeq == null ? 0 : this.queueSeq;
    }

    public double getQueueDetailSeqVal() {
        return this.queueDetailSeq == null ? 0 : this.queueDetailSeq;
    }
}
