Files
IOT_API/Model/Entity/Inspection/AlertRuleEntity.cs
T

90 lines
3.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using SqlSugar;
using System;
namespace Model.Entity.Inspection
{
/// <summary>
/// 告警规则(规则实例:查看所有设备告警的规则列表)
/// </summary>
public class AlertRuleEntity : BaseEntity
{
/// <summary>
/// 归属类型(0=全局/旧数据;1=产品 2=设备)
/// </summary>
[SugarColumn(ColumnDescription = "归属类型", DefaultValue = "0")]
public byte OwnerType { get; set; }
/// <summary>
/// 归属对象IdProductEntity.Id / IotDeviceEntity.Id0 表示全局)
/// </summary>
[SugarColumn(ColumnDescription = "归属对象Id", DefaultValue = "0")]
public long OwnerId { get; set; }
/// <summary>
/// 绑定点编码(关联物模型点 Code;为空表示整产品/设备级规则)
/// </summary>
[SugarColumn(ColumnDescription = "绑定点编码", Length = 64, IsNullable = true)]
public string? PointCode { get; set; }
/// <summary>
/// 规则名称
/// </summary>
[SugarColumn(ColumnDescription = "规则名称", Length = 100)]
public string RuleName { get; set; }
/// <summary>
/// 适用设备类型(空表示全部设备,如 TemperatureBox 温度箱)
/// </summary>
[SugarColumn(ColumnDescription = "适用设备类型", Length = 64, IsNullable = true)]
public string DeviceType { get; set; }
/// <summary>
/// 监测指标(Temperature 温度 / Humidity 湿度等)
/// </summary>
[SugarColumn(ColumnDescription = "监测指标", Length = 64)]
public string Metric { get; set; }
/// <summary>
/// 比较运算符(> >= < <= = ≠)
/// </summary>
[SugarColumn(ColumnDescription = "比较运算符", Length = 10)]
public string Operator { get; set; }
/// <summary>
/// 阈值
/// </summary>
[SugarColumn(ColumnDescription = "阈值", IsNullable = true)]
public double? Threshold { get; set; }
/// <summary>
/// 告警级别(信息/警告/紧急)
/// </summary>
[SugarColumn(ColumnDescription = "告警级别", Length = 32)]
public string AlarmLevel { get; set; }
/// <summary>
/// 是否启用
/// </summary>
[SugarColumn(ColumnDescription = "是否启用")]
public bool Enabled { get; set; } = true;
/// <summary>
/// 触发次数(系统统计)
/// </summary>
[SugarColumn(ColumnDescription = "触发次数")]
public int TriggerCount { get; set; }
/// <summary>
/// 最近触发时间(系统统计)
/// </summary>
[SugarColumn(ColumnDescription = "最近触发时间", IsNullable = true)]
public DateTime? LastAlarmTime { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
public string Remark { get; set; }
}
}