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_derived_table", comment = "数据中心派生表关系")
public class DatacenterDerivedTable 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 sourceTableId;
    @Column(comment = "派生表ID")
    private BigInteger derivedTableId;
    @Column(comment = "派生类型")
    private String deriveType;
    @Column(typeHandler = FastjsonTypeHandler.class, comment = "派生配置")
    private Map<String, Object> deriveConfigJson;
    @Column(comment = "状态")
    private Integer status;
    @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 getSourceTableId() { return sourceTableId; }
    public void setSourceTableId(BigInteger sourceTableId) { this.sourceTableId = sourceTableId; }
    public BigInteger getDerivedTableId() { return derivedTableId; }
    public void setDerivedTableId(BigInteger derivedTableId) { this.derivedTableId = derivedTableId; }
    public String getDeriveType() { return deriveType; }
    public void setDeriveType(String deriveType) { this.deriveType = deriveType; }
    public Map<String, Object> getDeriveConfigJson() { return deriveConfigJson; }
    public void setDeriveConfigJson(Map<String, Object> deriveConfigJson) { this.deriveConfigJson = deriveConfigJson; }
    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }
    @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; }
}
