package cn.estsh.i3plus.pojo.mes.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 javax.persistence.Transient;
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_STEP")
@Api("流程工序工步关系")
public class MesRouteProcessStep extends BaseBean implements Serializable {
    private static final long serialVersionUID = 6325935706401770213L;
    @Column(name = "ROUTE_CODE")
    @ApiParam("流程代码")
    private String routeCode;

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

    @Column(name = "STEP_CODE")
    @ApiParam("工步代码")
    private String stepCode;

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

    @Column(name = "PARAM_CODE")
    @ApiParam("工步参数代码")
    private String paramCode;

    @Column(name = "PARAM_TYPE")
    @ApiParam("工步参数类型")
    private Integer paramType;

    @Column(name = "PARAM_VALUE")
    @ApiParam("工步参数值")
    private String paramValue;

    @Column(name = "STEP_DISPLAY_NAME")
    @ApiParam("工步展示名称")
    private String stepDisplayName;

    @Transient
    @Column(name = "PARAM_ATTRIBUTE")
    @ApiParam("参数属性")
    private String paramAttribute;

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

    public int getParamTypeVal() {
        return this.paramType == null ? 0 : this.paramType;
    }
}
