using Admin.NET.Core; namespace Admin.NET.Plugin.AiDOP.Entity; /// /// 运营指标主数据(KPI Master),完整的指标定义含公式、规则、父子关系。 /// [SugarTable("ado_smart_ops_kpi_master", "运营指标主数据")] [SugarIndex("uk_kpi_master_code_tenant", nameof(MetricCode), OrderByType.Asc, nameof(TenantId), OrderByType.Asc, true)] public class AdoSmartOpsKpiMaster : ITenantIdFilter { [SugarColumn(ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")] public long Id { get; set; } [SugarColumn(ColumnDescription = "指标编码(自动生成 S1_L1_001)", Length = 50)] public string MetricCode { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "模块 S1~S9", Length = 20)] public string ModuleCode { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "层级 1=L1 2=L2 3=L3")] public int MetricLevel { get; set; } [SugarColumn(ColumnDescription = "父指标 ID(L1 为 null)", ColumnDataType = "bigint", IsNullable = true)] public long? ParentId { get; set; } [SugarColumn(ColumnDescription = "指标名称", Length = 200)] public string MetricName { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "KPI 描述", ColumnDataType = "text", IsNullable = true)] public string? Description { get; set; } [SugarColumn(ColumnDescription = "计算公式", ColumnDataType = "text", IsNullable = true)] public string? Formula { get; set; } [SugarColumn(ColumnDescription = "计算规则(含举例)", ColumnDataType = "text", IsNullable = true)] public string? CalcRule { get; set; } [SugarColumn(ColumnDescription = "数据来源模块", Length = 200, IsNullable = true)] public string? DataSource { get; set; } [SugarColumn(ColumnDescription = "统计频率", Length = 50, IsNullable = true)] public string? StatFrequency { get; set; } [SugarColumn(ColumnDescription = "责任部门", Length = 200, IsNullable = true)] public string? Department { get; set; } [SugarColumn(ColumnDescription = "DOP 系统字段映射", Length = 500, IsNullable = true)] public string? DopFields { get; set; } [SugarColumn(ColumnDescription = "单位", Length = 50, IsNullable = true)] public string? Unit { get; set; } [SugarColumn(ColumnDescription = "优劣方向 higher_is_better/lower_is_better", Length = 20)] public string Direction { get; set; } = "higher_is_better"; [SugarColumn(ColumnDescription = "黄色阈值(达标比例%,higher: actual/target>=此值为黄,lower: actual/target<=此值为黄)", IsNullable = true)] public decimal? YellowThreshold { get; set; } [SugarColumn(ColumnDescription = "红色阈值(未达标比例%,higher: actual/target<此值为红,lower: actual/target>此值为红)", IsNullable = true)] public decimal? RedThreshold { get; set; } [SugarColumn(ColumnDescription = "是否可上九宫格首页")] public bool IsHomePage { get; set; } [SugarColumn(ColumnDescription = "同级排序号")] public int SortNo { get; set; } [SugarColumn(ColumnDescription = "备注", ColumnDataType = "text", IsNullable = true)] public string? Remark { get; set; } [SugarColumn(ColumnDescription = "启用")] public bool IsEnabled { get; set; } = true; [SugarColumn(ColumnDescription = "租户 ID", ColumnDataType = "bigint")] public long? TenantId { get; set; } [SugarColumn(ColumnDescription = "创建时间")] public DateTime CreatedAt { get; set; } = DateTime.Now; [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)] public DateTime? UpdatedAt { get; set; } }