package com.purui.prims.headless.server.persistence.dataobject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * 数据集持久化配置
 *
 * @author charlie
 * @date 2024-06-19
 */
@Data
@TableName("pr_dataset_persistence_config")
public class DatasetPersistenceConfigDO {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 数据集ID
     */
    private Long datasetId;

    /**
     * 数据库ID
     */
    private Long databaseId;

    /**
     * 数据集表名
     */
    private String tableName;

    /**
     * 配置信息
     */
    private String defaultConfig;

    /**
     * 调度周期ID
     */
    private Integer runCycleId;

    /**
     * 开始时间
     */
    private Date startDate;

    /**
     * SQL脚本
     */
    private String taskScripts;

    /**
     * 创建日期
     */
    private Date createdAt;

    /**
     * 修改日期
     */
    private Date updatedAt;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 修改人
     */
    private String updatedBy;

    public Long getId() {
        return id;
    }

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

    public Long getDatasetId() {
        return datasetId;
    }

    public void setDatasetId(Long datasetId) {
        this.datasetId = datasetId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName == null ? null : tableName.trim();
    }

    public String getDefaultConfig() {
        return defaultConfig;
    }

    public void setDefaultConfig(String defaultConfig) {
        this.defaultConfig = defaultConfig == null ? null : defaultConfig.trim();
    }

    public Integer getRunCycleId() {
        return runCycleId;
    }

    public void setRunCycleId(Integer runCycleId) {
        this.runCycleId = runCycleId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public String getTaskScripts() {
        return taskScripts;
    }

    public void setTaskScripts(String taskScripts) {
        this.taskScripts = taskScripts == null ? null : taskScripts.trim();
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy == null ? null : createdBy.trim();
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy == null ? null : updatedBy.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", datasetId=").append(datasetId);
        sb.append(", tableName=").append(tableName);
        sb.append(", defaultConfig=").append(defaultConfig);
        sb.append(", runCycleId=").append(runCycleId);
        sb.append(", startDate=").append(startDate);
        sb.append(", taskScripts=").append(taskScripts);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", updatedBy=").append(updatedBy);
        sb.append("]");
        return sb.toString();
    }
}