using Admin.NET.Core; using SqlSugar; namespace Admin.NET.Plugin.AiDOP.Entity; /// /// KPI 维度结果(配置化维度执行产物)。由 DIMENSION_SQL 经数据中台执行后落库, /// 供筛选与下钻读取。每行记录归属的汇总/维度配置版本,查询时校验版本一致。 /// 独立新表,绝不复用被旧硬编码污染的 ado_smart_ops_kpi_atomic_day。 /// [SugarTable("ado_smart_ops_kpi_dimension_value_day", "KPI 维度结果(配置化)")] [SugarIndex("uk_kpi_dim_val_rowhash", nameof(RowHash), OrderByType.Asc, true)] [SugarIndex("ix_kpi_dim_val_query", nameof(TenantId), OrderByType.Asc, nameof(MetricCode), OrderByType.Asc, nameof(DimensionConfigVersion), OrderByType.Asc, nameof(ValueDate), OrderByType.Asc)] public class AdoSmartOpsKpiDimensionValueDay : ITenantIdFilter { [SugarColumn(ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")] public long Id { get; set; } [SugarColumn(ColumnDescription = "租户 ID", ColumnDataType = "bigint", IsNullable = true)] public long? TenantId { get; set; } [SugarColumn(ColumnDescription = "模块 S1~S9", Length = 20)] public string ModuleCode { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "指标编码", Length = 50)] public string MetricCode { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "绑定的汇总配置 Id")] public long SummaryConfigId { get; set; } [SugarColumn(ColumnDescription = "绑定的汇总配置版本号")] public int SummaryConfigVersion { get; set; } [SugarColumn(ColumnDescription = "维度配置 Id")] public long DimensionConfigId { get; set; } [SugarColumn(ColumnDescription = "维度配置版本号")] public int DimensionConfigVersion { get; set; } [SugarColumn(ColumnDescription = "数据源编码", Length = 100, IsNullable = true)] public string? DataSourceCode { get; set; } [SugarColumn(ColumnDescription = "业务日期(日粒度取日、月粒度取月首日)")] public DateTime ValueDate { get; set; } [SugarColumn(ColumnDescription = "维度类型 如 ORDER / MATERIAL / CATEGORY", Length = 40)] public string DimensionType { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "维度编码", Length = 200)] public string DimensionCode { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "维度名称", Length = 300, IsNullable = true)] public string? DimensionName { get; set; } [SugarColumn(ColumnDescription = "组织 ID", ColumnDataType = "bigint", IsNullable = true)] public long? OrgId { get; set; } [SugarColumn(ColumnDescription = "工厂 ID", ColumnDataType = "bigint", IsNullable = true)] public long? FactoryId { get; set; } [SugarColumn(ColumnDescription = "物料编码", Length = 100, IsNullable = true)] public string? MaterialCode { get; set; } [SugarColumn(ColumnDescription = "工单号", Length = 100, IsNullable = true)] public string? WorkOrderNo { get; set; } [SugarColumn(ColumnDescription = "品类编码", Length = 100, IsNullable = true)] public string? CategoryCode { get; set; } [SugarColumn(ColumnDescription = "仓库编码", Length = 100, IsNullable = true)] public string? WarehouseCode { get; set; } [SugarColumn(ColumnDescription = "订单号", Length = 100, IsNullable = true)] public string? OrderNo { get; set; } [SugarColumn(ColumnDescription = "客户编码", Length = 100, IsNullable = true)] public string? CustomerCode { get; set; } [SugarColumn(ColumnDescription = "产品编码", Length = 100, IsNullable = true)] public string? ProductCode { get; set; } [SugarColumn(ColumnDescription = "设备编码", Length = 100, IsNullable = true)] public string? EquipmentCode { get; set; } [SugarColumn(ColumnDescription = "指标值", ColumnDataType = "decimal(18,6)", IsNullable = true)] public decimal? MetricValue { get; set; } [SugarColumn(ColumnDescription = "分子", ColumnDataType = "decimal(18,6)", IsNullable = true)] public decimal? Numerator { get; set; } [SugarColumn(ColumnDescription = "分母", ColumnDataType = "decimal(18,6)", IsNullable = true)] public decimal? Denominator { get; set; } [SugarColumn(ColumnDescription = "求和值", ColumnDataType = "decimal(18,6)", IsNullable = true)] public decimal? SumValue { get; set; } [SugarColumn(ColumnDescription = "样本数", IsNullable = true)] public int? SampleCount { get; set; } [SugarColumn(ColumnDescription = "来源业务键", Length = 200, IsNullable = true)] public string? SourceKey { get; set; } [SugarColumn(ColumnDescription = "幂等行哈希(SHA256 hex)", Length = 64)] public string RowHash { get; set; } = string.Empty; [SugarColumn(ColumnDescription = "批次号", Length = 100, IsNullable = true)] public string? BatchId { get; set; } [SugarColumn(ColumnDescription = "计算时间")] public DateTime CalcTime { get; set; } [SugarColumn(ColumnDescription = "创建时间")] public DateTime CreatedTime { get; set; } [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)] public DateTime? UpdatedTime { get; set; } }