using SqlSugar; using System; namespace Model.Entity.Inspection { /// /// 告警规则(规则实例:查看所有设备告警的规则列表) /// public class AlertRuleEntity : BaseEntity { /// /// 规则名称 /// [SugarColumn(ColumnDescription = "规则名称", Length = 100)] public string RuleName { get; set; } /// /// 适用设备类型(空表示全部设备,如 TemperatureBox 温度箱) /// [SugarColumn(ColumnDescription = "适用设备类型", Length = 64, IsNullable = true)] public string DeviceType { get; set; } /// /// 监测指标(Temperature 温度 / Humidity 湿度等) /// [SugarColumn(ColumnDescription = "监测指标", Length = 64)] public string Metric { get; set; } /// /// 比较运算符(> >= < <= = ≠) /// [SugarColumn(ColumnDescription = "比较运算符", Length = 10)] public string Operator { get; set; } /// /// 阈值 /// [SugarColumn(ColumnDescription = "阈值", IsNullable = true)] public double? Threshold { get; set; } /// /// 告警级别(信息/警告/紧急) /// [SugarColumn(ColumnDescription = "告警级别", Length = 32)] public string AlarmLevel { get; set; } /// /// 是否启用 /// [SugarColumn(ColumnDescription = "是否启用")] public bool Enabled { get; set; } = true; /// /// 触发次数(系统统计) /// [SugarColumn(ColumnDescription = "触发次数")] public int TriggerCount { get; set; } /// /// 最近触发时间(系统统计) /// [SugarColumn(ColumnDescription = "最近触发时间", IsNullable = true)] public DateTime? LastAlarmTime { get; set; } /// /// 备注 /// [SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)] public string Remark { get; set; } } }