AdoS8WatchRule.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8;
  2. [SugarTable("ado_s8_watch_rule", "S8 监视规则")]
  3. [SugarIndex("idx_s8_watch_rule_type", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(RuleType), OrderByType.Asc)]
  4. [SugarIndex("idx_s8_watch_rule_source_object", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(SourceObjectType), OrderByType.Asc)]
  5. public class AdoS8WatchRule
  6. {
  7. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  8. public long Id { get; set; }
  9. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  10. public long TenantId { get; set; }
  11. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  12. public long FactoryId { get; set; }
  13. [SugarColumn(ColumnName = "rule_code", Length = 64)]
  14. public string RuleCode { get; set; } = string.Empty;
  15. [SugarColumn(ColumnName = "scene_code", Length = 64)]
  16. public string SceneCode { get; set; } = string.Empty;
  17. [SugarColumn(ColumnName = "data_source_id", ColumnDataType = "bigint")]
  18. public long DataSourceId { get; set; }
  19. [SugarColumn(ColumnName = "watch_object_type", Length = 64)]
  20. public string WatchObjectType { get; set; } = string.Empty;
  21. [SugarColumn(ColumnName = "expression", Length = 2000, IsNullable = true)]
  22. public string? Expression { get; set; }
  23. [SugarColumn(ColumnName = "severity", Length = 32)]
  24. public string Severity { get; set; } = "MEDIUM";
  25. [SugarColumn(ColumnName = "poll_interval_seconds")]
  26. public int PollIntervalSeconds { get; set; } = 300;
  27. [SugarColumn(ColumnName = "enabled", ColumnDataType = "boolean")]
  28. public bool Enabled { get; set; }
  29. [SugarColumn(ColumnName = "created_at")]
  30. public DateTime CreatedAt { get; set; } = DateTime.Now;
  31. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  32. public DateTime? UpdatedAt { get; set; }
  33. /// <summary>规则类型:TIMEOUT / SHORTAGE / OUT_OF_RANGE。R1 仅落列,evaluator 不分派。</summary>
  34. [SugarColumn(ColumnName = "rule_type", Length = 32, IsNullable = true)]
  35. public string? RuleType { get; set; }
  36. /// <summary>源对象类型(DEVICE / ORDER / MATERIAL / QUALITY_CHECK 等)。R1 与 watch_object_type 可保持一致。</summary>
  37. [SugarColumn(ColumnName = "source_object_type", Length = 64, IsNullable = true)]
  38. public string? SourceObjectType { get; set; }
  39. /// <summary>规则类型相关结构化参数 JSON。R1 仅预留,service 不解析。</summary>
  40. [SugarColumn(ColumnName = "params_json", ColumnDataType = "mediumtext", IsNullable = true)]
  41. public string? ParamsJson { get; set; }
  42. }