package org.springblade.etl.entity;

import java.time.LocalDateTime;

import javax.validation.constraints.NotEmpty;

import org.springblade.core.mp.base.TenantEntity;
import org.springblade.etl.enums.JobStatus;
import org.springblade.etl.enums.JobType;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 任务定义表 etl_job
 * 
 * @author aokunsang
 * @date 2023-07-28
 */
@Data
@TableName("etl_job")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Job对象", description = "任务定义")
public class Job extends TenantEntity{

	private static final long serialVersionUID = 1L;
	
 	/** 
	 *  
	 */
	@TableId(type = IdType.AUTO)
	private Integer id;

	/** 
	 * 任务名称 
	 */
	@ApiModelProperty(value = "任务名称")
	@NotEmpty(message = "任务名称不能为空")
	@TableField(condition = SqlCondition.LIKE)
	private String jobName;
	
	/** 
	 * 分类ID
	 */
	@ApiModelProperty(value = "分类ID")
	private Integer categoryId;

	/** 
	 * 作业状态(草稿、发布、归档) 
	 */
	@ApiModelProperty(value = "作业状态(草稿、发布、归档)")
	private JobStatus jobStatus;

	/** 
	 * 任务类型(流任务 批任务) 
	 */
	@ApiModelProperty(value = "任务类型")
	private JobType jobType;

	/** 
	 * 创建时间 
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	/** 
	 * 创建人ID 
	 */
	@ApiModelProperty(value = "创建人ID")
	private Long createUserId;

	/** 
	 * 创建人姓名 
	 */
	@ApiModelProperty(value = "创建人姓名")
	private String createBy;
	
	/** 
	 * 创建时间 
	 */
	@ApiModelProperty(value = "更新时间")
	private LocalDateTime updateTime;
	
	/** 
	 * 更新人ID 
	 */
	@ApiModelProperty(value = "更新人ID")
	private Long updateUserId;
	
	/** 
	 * 更新人ID 
	 */
	@ApiModelProperty(value = "更新人姓名")
	private String updateBy;

	/** 
	 * 全局参数 
	 */
	@ApiModelProperty(value = "全局参数json")
	private String globalParam;
	
	@ApiModelProperty(value = "xxljob任务ID")
	private Integer xxlJobId;
	
	@ApiModelProperty(value = "任务Cron")
	private String jobCron;
	
	@ApiModelProperty(value = "定时任务是否开启")
	private Integer triggerStatus;
	
	@ApiModelProperty(value = "是否公开状态")
	private Integer publicStatus;
}
