package com.template.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 数据源操作日志
 * </p>
 *
 * @author ceshi
 * @since 2023-12-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SmartDataTask对象", description="数据源任务管理")
public class SmartDataTask implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "tk_id", type = IdType.AUTO)
    private Integer tkId;

    @ApiModelProperty(value = "任务名称")
    private String tkName;

    @ApiModelProperty(value = "部门id")
    private Integer tkDtId;

    @ApiModelProperty(value = "来源数据源id")
    private Integer tkDsIdSource;

    @ApiModelProperty(value = "同步策略：0插入更新，1更新标记，2清空插入")
    private Integer tkSyncPolicy;

    @ApiModelProperty(value = "交换方式：0自定义SQL语句，1数据视图，2数据表")
    private Integer tkExchangeType;

    @ApiModelProperty(value = "任务使用的SQL语句")
    private String tkSql;

    @ApiModelProperty(value = "目标数据源id")
    private Integer tkDsIdDestination;

    @ApiModelProperty(value = "目标数据表")
    private String tkDestTable;

    @ApiModelProperty(value = "交换服务器")
    private String tkExchangeServer;

    @ApiModelProperty(value = "交换服务器id")
    private Integer tkExchangeServerId;

    @ApiModelProperty(value = "运行参数配置：0自动，1手动")
    private Integer tkOptCfgAutoManual;

    @ApiModelProperty(value = "运行参数配置：手动配置的记录数")
    private Integer tkOptCfgRsNum;

    @ApiModelProperty(value = "运行参数配置：默认的记录数")
    private Integer tkOptCfgDefaultRsNum;

    @ApiModelProperty(value = "运行参数配置：线程数")
    private Integer tkOptCfgThreadsNum;

    @ApiModelProperty(value = "是否记录错误数据：0是，1否")
    private Integer tkRsIncorrectData;

    @ApiModelProperty(value = "来源数据源字符集：UTF8 或 GBK")
    private String tkDsSourceCharset;

    @ApiModelProperty(value = "目的数据源字符集：UTF8 或 GBK")
    private String tkDsDestinationCharset;

    @ApiModelProperty(value = "任务定时表达式")
    private String tkCron;

    @ApiModelProperty(value = "手动或者定时执行：0定时执行，1手动执行")
    private Integer tkManualOrAuto;

    @ApiModelProperty(value = "执行方式：0间隔执行，1定点执行，2每天，3每周，4每月")
    private Integer tkExeType;

    @ApiModelProperty(value = "重复时间")
    private String tkRepeatTime;

    @ApiModelProperty(value = "是否激活")
    private Integer tkActivation;

    @ApiModelProperty(value = "字段对应关系")
    private String tkColRelationship;

    @ApiModelProperty(value = "删除标记")
    private Integer tkDeleted;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "下次执行时间")
    private String tkNextExeTime;

    @ApiModelProperty(value = "调试SQL语句")
    private Integer tkDebugSql;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date tkCreateTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    private Date tkUpdateTime;
}
