package cn.estsh.i3plus.pojo.ptl.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 :ptl-pcn定时任务工作清单
 * @Reference :
 * @Author : wangjie
 * @CreateDate : 2019-08-26
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "PTL_PCN_TASK")
@Api("ptl-pcn定时任务工作清单")
public class PtlPcnTask extends BaseBean implements Serializable {

    private static final long serialVersionUID = 2486815585819368941L;

    @Column(name = "TASK_CODE")
    @ApiParam("任务代码")
    private String taskCode;

    @Column(name = "TASK_NAME")
    @ApiParam("任务名称")
    private String taskName;

    @Column(name = "TASK_GROUP_NAME")
    @ApiParam("任务组名称")
    private String taskGroupName;

    @Column(name = "TASK_DESCRIPTION")
    @ApiParam("任务描述")
    private String taskDescription;

    @Column(name = "TASK_TYPE")
    @ApiParam("任务类型")
    private Integer taskType;

    @Column(name = "TASK_MODULE")
    @ApiParam("任务模块")
    private String taskModule;

    @Column(name = "TASK_CLASS")
    @ApiParam("任务类名")
    private String taskClass;

    @Column(name = "TASK_PACKAGE")
    @ApiParam("任务包名")
    private String taskPackage;

    @Column(name = "PCN_NAME")
    @ApiParam("PCN节点名称")
    private String pcnName;

    @Column(name = "PCN_CODE")
    @ApiParam("PCN节点名称代码")
    private String pcnCode;

    @Column(name = "TASK_CYCLE_EXPS")
    @ApiParam("任务周期表达式")
    private String taskCycleExps;

    @Column(name = "TASK_CYCLE_DESCRIPTION")
    @ApiParam("任务周期描述")
    private String taskCycleDescription;

    @Column(name = "TASK_PARAM")
    @ApiParam("任务参数")
    private String taskParam;

    public int getTaskTypeVal() {
        return this.taskType == null ? 0 : this.taskType;
    }

}
