package com.qmth.distributed.print.business.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.distributed.print.business.enums.FlowJoinTypeEnum;
import com.qmth.teachcloud.common.contant.SystemConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 考试任务和流程关联表
 * </p>
 *
 * @author wangliang
 * @since 2021-11-22
 */
@ApiModel(value = "TFFlowJoin对象", description = "实体和流程关联表")
public class TFFlowJoin implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "自定义流程实体id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long flowEntityId;

    @ApiModelProperty(value = "实体表")
    private String objectTable;

    @ApiModelProperty(value = "实体id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long objectId;

    @ApiModelProperty(value = "流程id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long flowId;

    @ApiModelProperty(value = "流程等级")
    private Integer level;

    @ApiModelProperty(value = "类型")
    private FlowJoinTypeEnum type;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("create_id")
    @ApiModelProperty(value = "创建人")
    private Long createId;

    @TableField(value = "create_time", fill = FieldFill.INSERT)//新增执行
    @ApiModelProperty(value = "创建时间")
    private Long createTime;

    public TFFlowJoin() {

    }

    public TFFlowJoin(Long flowEntityId, Long objectId, Long flowId, Integer level, FlowJoinTypeEnum type, Long userId, String objectTable) {
        setId(SystemConstant.getDbUuid());
        this.flowEntityId = flowEntityId;
        this.objectId = objectId;
        this.flowId = flowId;
        this.level = level;
        this.type = type;
        this.objectTable = objectTable;
        this.createId = userId;
        this.createTime = System.currentTimeMillis();
    }

    public FlowJoinTypeEnum getType() {
        return type;
    }

    public void setType(FlowJoinTypeEnum type) {
        this.type = type;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getFlowEntityId() {
        return flowEntityId;
    }

    public void setFlowEntityId(Long flowEntityId) {
        this.flowEntityId = flowEntityId;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getObjectTable() {
        return objectTable;
    }

    public void setObjectTable(String objectTable) {
        this.objectTable = objectTable;
    }

    public Long getObjectId() {
        return objectId;
    }

    public void setObjectId(Long objectId) {
        this.objectId = objectId;
    }

    public Long getFlowId() {
        return flowId;
    }

    public void setFlowId(Long flowId) {
        this.flowId = flowId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }
}
