AdoSmartOpsKpiAtomicDay.cs 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. namespace Admin.NET.Plugin.AiDOP.Entity;
  2. /// <summary>
  3. /// KPI 最小颗粒度原子聚合层(日粒度)。存可二次聚合基础量,不存模块级最终汇总。
  4. /// 表结构由 AidopTenantMigration 与版本迁移脚本维护,禁止全局 CodeFirst 对大表做启动期 ALTER。
  5. /// </summary>
  6. [IgnoreTable]
  7. [SugarTable("ado_smart_ops_kpi_atomic_day", "KPI原子聚合层(日)")]
  8. public class AdoSmartOpsKpiAtomicDay
  9. {
  10. [SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  11. public long Id { get; set; }
  12. [SugarColumn(ColumnName = "tenant_id", ColumnDescription = "租户ID", ColumnDataType = "bigint")]
  13. public long TenantId { get; set; }
  14. [SugarColumn(ColumnName = "factory_id", ColumnDescription = "工厂ID", ColumnDataType = "bigint", DefaultValue = "1")]
  15. public long FactoryId { get; set; } = 1;
  16. [SugarColumn(ColumnName = "domain_code", ColumnDescription = "业务对象域", Length = 50)]
  17. public string DomainCode { get; set; } = string.Empty;
  18. [SugarColumn(ColumnName = "metric_code", ColumnDescription = "指标编码", Length = 50)]
  19. public string MetricCode { get; set; } = string.Empty;
  20. [SugarColumn(ColumnName = "metric_level", ColumnDescription = "指标层级", ColumnDataType = "tinyint", DefaultValue = "1")]
  21. public int MetricLevel { get; set; } = 1;
  22. [SugarColumn(ColumnName = "stat_date", ColumnDescription = "统计日期", ColumnDataType = "date")]
  23. public DateTime StatDate { get; set; }
  24. [SugarColumn(ColumnName = "customer_code", ColumnDescription = "客户编码", Length = 100, DefaultValue = "")]
  25. public string CustomerCode { get; set; } = string.Empty;
  26. [SugarColumn(ColumnName = "product_code", ColumnDescription = "产品编码", Length = 100, DefaultValue = "")]
  27. public string ProductCode { get; set; } = string.Empty;
  28. [SugarColumn(ColumnName = "order_no", ColumnDescription = "订单号", Length = 100, DefaultValue = "")]
  29. public string OrderNo { get; set; } = string.Empty;
  30. [SugarColumn(ColumnName = "production_line", ColumnDescription = "产线", Length = 100, DefaultValue = "")]
  31. public string ProductionLine { get; set; } = string.Empty;
  32. [SugarColumn(ColumnName = "supplier_code", ColumnDescription = "供应商编码", Length = 100, DefaultValue = "")]
  33. public string SupplierCode { get; set; } = string.Empty;
  34. [SugarColumn(ColumnName = "material_code", ColumnDescription = "物料编码", Length = 100, DefaultValue = "")]
  35. public string MaterialCode { get; set; } = string.Empty;
  36. [SugarColumn(ColumnName = "po_no", ColumnDescription = "采购单号", Length = 100, DefaultValue = "")]
  37. public string PoNo { get; set; } = string.Empty;
  38. [SugarColumn(ColumnName = "warehouse_code", ColumnDescription = "仓库编码", Length = 100, DefaultValue = "")]
  39. public string WarehouseCode { get; set; } = string.Empty;
  40. [SugarColumn(ColumnName = "work_order_no", ColumnDescription = "工单号", Length = 100, DefaultValue = "")]
  41. public string WorkOrderNo { get; set; } = string.Empty;
  42. [SugarColumn(ColumnName = "equipment_code", ColumnDescription = "设备编码", Length = 100, DefaultValue = "")]
  43. public string EquipmentCode { get; set; } = string.Empty;
  44. [SugarColumn(ColumnName = "outbound_no", ColumnDescription = "出库单号", Length = 100, DefaultValue = "")]
  45. public string OutboundNo { get; set; } = string.Empty;
  46. [SugarColumn(ColumnName = "sum_value", ColumnDescription = "可累加值", Length = 18, DecimalDigits = 6, IsNullable = true)]
  47. public decimal? SumValue { get; set; }
  48. [SugarColumn(ColumnName = "numerator_value", ColumnDescription = "比率分子", Length = 18, DecimalDigits = 6, IsNullable = true)]
  49. public decimal? NumeratorValue { get; set; }
  50. [SugarColumn(ColumnName = "denominator_value", ColumnDescription = "比率分母", Length = 18, DecimalDigits = 6, IsNullable = true)]
  51. public decimal? DenominatorValue { get; set; }
  52. [SugarColumn(ColumnName = "sample_count", ColumnDescription = "样本数", IsNullable = true)]
  53. public int? SampleCount { get; set; }
  54. [SugarColumn(ColumnName = "min_value", ColumnDescription = "最小值", Length = 18, DecimalDigits = 6, IsNullable = true)]
  55. public decimal? MinValue { get; set; }
  56. [SugarColumn(ColumnName = "max_value", ColumnDescription = "最大值", Length = 18, DecimalDigits = 6, IsNullable = true)]
  57. public decimal? MaxValue { get; set; }
  58. [SugarColumn(ColumnName = "batch_id", ColumnDescription = "MDP批次", Length = 100, IsNullable = true)]
  59. public string? BatchId { get; set; }
  60. [SugarColumn(ColumnName = "calc_time", ColumnDescription = "计算时间", IsNullable = true)]
  61. public DateTime? CalcTime { get; set; }
  62. [SugarColumn(ColumnName = "grain", ColumnDescription = "统计粒度", Length = 20, DefaultValue = "day")]
  63. public string Grain { get; set; } = "day";
  64. [SugarColumn(ColumnName = "is_deleted", ColumnDescription = "删除标识", ColumnDataType = "tinyint", DefaultValue = "0")]
  65. public int IsDeleted { get; set; }
  66. }