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 java.io.Serializable;

/**
 * @Description :流程工序关系
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_ROUTE_PROCESS")
@Api("流程工序关系")
public class MesRouteProcess extends BaseBean implements Serializable {
    private static final long serialVersionUID = 3477334942090180010L;

    @Column(name = "ROUTE_CODE")
    @ApiParam("流程代码")
    private String routeCode;

    @Column(name = "PROCESS_CODE")
    @ApiParam("工序代码")
    private String processCode;

    @Column(name = "NEXT_PROCESS")
    @ApiParam("下一工序")
    private String nextProcess;

    @Column(name = "REPAIR_PROCESS")
    @ApiParam("维修工序")
    private String repairProcess;

    @Column(name = "SEQ")
    @ApiParam("顺序")
    private Integer seq;

    @Column(name = "IS_NECESSARY")
    @ApiParam("是否必须")
    private Integer isNecessary;

    public int getSeqVal() {
        return this.seq == null ? 0 : this.seq;
    }

    public int getIsNecessaryVal() {
        return this.isNecessary == null ? 0 : this.isNecessary;
    }
}
