package tech.easyflow.datacenter.meta.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.FastjsonTypeHandler;
import tech.easyflow.common.entity.DateEntity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.Map;

@Table(value = "tb_datacenter_import_job", comment = "数据中心导入任务")
public class DatacenterImportJob extends DateEntity implements Serializable {
    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    private BigInteger id;
    @Column(comment = "部门ID")
    private BigInteger deptId;
    @Column(tenantId = true, comment = "租户ID")
    private BigInteger tenantId;
    @Column(comment = "数据源ID")
    private BigInteger sourceId;
    @Column(comment = "目录ID")
    private BigInteger catalogId;
    @Column(comment = "表ID")
    private BigInteger tableId;
    @Column(comment = "任务类型")
    private String jobType;
    @Column(comment = "文件名")
    private String fileName;
    @Column(comment = "文件存储路径")
    private String storagePath;
    @Column(comment = "任务状态")
    private String status;
    @Column(comment = "总行数")
    private Long totalRows;
    @Column(comment = "成功行数")
    private Long successRows;
    @Column(comment = "失败行数")
    private Long errorRows;
    @Column(comment = "错误摘要")
    private String errorSummary;
    @Column(typeHandler = FastjsonTypeHandler.class, comment = "任务载荷")
    private Map<String, Object> payloadJson;
    @Column(comment = "开始时间")
    private Date startedAt;
    @Column(comment = "结束时间")
    private Date finishedAt;
    @Column(comment = "创建时间")
    private Date created;
    @Column(comment = "创建人")
    private BigInteger createdBy;
    @Column(comment = "修改时间")
    private Date modified;
    @Column(comment = "修改人")
    private BigInteger modifiedBy;

    public BigInteger getId() { return id; }
    public void setId(BigInteger id) { this.id = id; }
    public BigInteger getDeptId() { return deptId; }
    public void setDeptId(BigInteger deptId) { this.deptId = deptId; }
    public BigInteger getTenantId() { return tenantId; }
    public void setTenantId(BigInteger tenantId) { this.tenantId = tenantId; }
    public BigInteger getSourceId() { return sourceId; }
    public void setSourceId(BigInteger sourceId) { this.sourceId = sourceId; }
    public BigInteger getCatalogId() { return catalogId; }
    public void setCatalogId(BigInteger catalogId) { this.catalogId = catalogId; }
    public BigInteger getTableId() { return tableId; }
    public void setTableId(BigInteger tableId) { this.tableId = tableId; }
    public String getJobType() { return jobType; }
    public void setJobType(String jobType) { this.jobType = jobType; }
    public String getFileName() { return fileName; }
    public void setFileName(String fileName) { this.fileName = fileName; }
    public String getStoragePath() { return storagePath; }
    public void setStoragePath(String storagePath) { this.storagePath = storagePath; }
    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }
    public Long getTotalRows() { return totalRows; }
    public void setTotalRows(Long totalRows) { this.totalRows = totalRows; }
    public Long getSuccessRows() { return successRows; }
    public void setSuccessRows(Long successRows) { this.successRows = successRows; }
    public Long getErrorRows() { return errorRows; }
    public void setErrorRows(Long errorRows) { this.errorRows = errorRows; }
    public String getErrorSummary() { return errorSummary; }
    public void setErrorSummary(String errorSummary) { this.errorSummary = errorSummary; }
    public Map<String, Object> getPayloadJson() { return payloadJson; }
    public void setPayloadJson(Map<String, Object> payloadJson) { this.payloadJson = payloadJson; }
    public Date getStartedAt() { return startedAt; }
    public void setStartedAt(Date startedAt) { this.startedAt = startedAt; }
    public Date getFinishedAt() { return finishedAt; }
    public void setFinishedAt(Date finishedAt) { this.finishedAt = finishedAt; }
    @Override public Date getCreated() { return created; }
    @Override public void setCreated(Date created) { this.created = created; }
    public BigInteger getCreatedBy() { return createdBy; }
    public void setCreatedBy(BigInteger createdBy) { this.createdBy = createdBy; }
    @Override public Date getModified() { return modified; }
    @Override public void setModified(Date modified) { this.modified = modified; }
    public BigInteger getModifiedBy() { return modifiedBy; }
    public void setModifiedBy(BigInteger modifiedBy) { this.modifiedBy = modifiedBy; }
}
