AdoSmartOpsBusinessFact.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Admin.NET.Core;
  2. namespace Admin.NET.Plugin.AiDOP.Entity;
  3. /// <summary>
  4. /// 业务事实字典:供 KpiMaster.FormulaExpr 以 $FactCode 形式引用的分子/分母来源。
  5. /// 下一批做 ETL 规则时将把 FactCode 映射到具体 SQL 模板。
  6. /// </summary>
  7. [SugarTable("ado_smart_ops_business_fact", "业务事实字典")]
  8. [SugarIndex("uk_fact_code_tenant", nameof(FactCode), OrderByType.Asc, nameof(TenantId), OrderByType.Asc, true)]
  9. public class AdoSmartOpsBusinessFact : ITenantIdFilter
  10. {
  11. [SugarColumn(ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  12. public long Id { get; set; }
  13. [SugarColumn(ColumnDescription = "事实编码(英文稳定码)", Length = 64)]
  14. public string FactCode { get; set; } = string.Empty;
  15. [SugarColumn(ColumnDescription = "事实名称(中文展示)", Length = 200)]
  16. public string FactName { get; set; } = string.Empty;
  17. [SugarColumn(ColumnDescription = "归属模块 S1~S9 或 COMMON", Length = 20, IsNullable = true)]
  18. public string? ModuleCode { get; set; }
  19. [SugarColumn(ColumnDescription = "单位", Length = 50, IsNullable = true)]
  20. public string? Unit { get; set; }
  21. [SugarColumn(ColumnDescription = "聚合类型 COUNT/SUM/AVG/MAX/MIN/LATEST", Length = 20, IsNullable = true)]
  22. public string? AggType { get; set; }
  23. [SugarColumn(ColumnDescription = "预期数据来源", Length = 200, IsNullable = true)]
  24. public string? DataSource { get; set; }
  25. [SugarColumn(ColumnDescription = "说明", ColumnDataType = "text", IsNullable = true)]
  26. public string? Description { get; set; }
  27. [SugarColumn(ColumnDescription = "启用")]
  28. public bool IsEnabled { get; set; } = true;
  29. [SugarColumn(ColumnDescription = "排序号")]
  30. public int SortNo { get; set; }
  31. [SugarColumn(ColumnDescription = "租户 ID", ColumnDataType = "bigint")]
  32. public long? TenantId { get; set; }
  33. [SugarColumn(ColumnDescription = "创建时间")]
  34. public DateTime CreatedAt { get; set; } = DateTime.Now;
  35. [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)]
  36. public DateTime? UpdatedAt { get; set; }
  37. }