AdoSmartOpsKpiDimensionRunLog.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using Admin.NET.Core;
  2. using SqlSugar;
  3. namespace Admin.NET.Plugin.AiDOP.Entity;
  4. /// <summary>
  5. /// KPI 维度执行运行日志。记录每次维度 SQL 执行的配置版本/数据源/状态/行数/耗时/错误/SQL 指纹。
  6. /// 不落明文 SQL;同批次同指标唯一。
  7. /// </summary>
  8. [SugarTable("ado_smart_ops_kpi_dimension_run_log", "KPI 维度执行运行日志")]
  9. [SugarIndex("uk_kpi_dim_run_metric_batch", nameof(MetricCode), OrderByType.Asc, nameof(BatchId), OrderByType.Asc, true)]
  10. public class AdoSmartOpsKpiDimensionRunLog : ITenantIdFilter
  11. {
  12. [SugarColumn(ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  13. public long Id { get; set; }
  14. [SugarColumn(ColumnDescription = "租户 ID", ColumnDataType = "bigint", IsNullable = true)]
  15. public long? TenantId { get; set; }
  16. [SugarColumn(ColumnDescription = "批次号", Length = 100)]
  17. public string BatchId { get; set; } = string.Empty;
  18. [SugarColumn(ColumnDescription = "模块", Length = 20)]
  19. public string ModuleCode { get; set; } = string.Empty;
  20. [SugarColumn(ColumnDescription = "指标编码", Length = 50)]
  21. public string MetricCode { get; set; } = string.Empty;
  22. [SugarColumn(ColumnDescription = "维度配置 Id", IsNullable = true)]
  23. public long? DimensionConfigId { get; set; }
  24. [SugarColumn(ColumnDescription = "维度配置版本号", IsNullable = true)]
  25. public int? DimensionConfigVersion { get; set; }
  26. [SugarColumn(ColumnDescription = "绑定的汇总配置版本号", IsNullable = true)]
  27. public int? SummaryConfigVersion { get; set; }
  28. [SugarColumn(ColumnDescription = "数据源编码", Length = 100, IsNullable = true)]
  29. public string? DataSourceCode { get; set; }
  30. [SugarColumn(ColumnDescription = "业务日期")]
  31. public DateTime BizDate { get; set; }
  32. [SugarColumn(ColumnDescription = "开始时间")]
  33. public DateTime StartedAt { get; set; }
  34. [SugarColumn(ColumnDescription = "结束时间", IsNullable = true)]
  35. public DateTime? FinishedAt { get; set; }
  36. [SugarColumn(ColumnDescription = "耗时毫秒", IsNullable = true)]
  37. public long? DurationMs { get; set; }
  38. [SugarColumn(ColumnDescription = "状态 SUCCESS/NO_DATA/FAILED/NOT_CONFIGURED/VERSION_MISMATCH/VALIDATION_FAILED/TIMEOUT", Length = 30)]
  39. public string Status { get; set; } = string.Empty;
  40. [SugarColumn(ColumnDescription = "结果行数")]
  41. public int RowCount { get; set; }
  42. [SugarColumn(ColumnDescription = "错误码", Length = 60, IsNullable = true)]
  43. public string? ErrorCode { get; set; }
  44. [SugarColumn(ColumnDescription = "错误摘要", ColumnDataType = "text", IsNullable = true)]
  45. public string? ErrorMessage { get; set; }
  46. [SugarColumn(ColumnDescription = "SQL 指纹(SHA256 hex,无明文)", Length = 64, IsNullable = true)]
  47. public string? SqlHash { get; set; }
  48. [SugarColumn(ColumnDescription = "触发类型 AUTO/MANUAL/PREVIEW", Length = 20, IsNullable = true)]
  49. public string? TriggerType { get; set; }
  50. [SugarColumn(ColumnDescription = "创建时间")]
  51. public DateTime CreateTime { get; set; }
  52. }