using DMS.Core.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
namespace DMS.Infrastructure.Entities;
///
/// 变量表
///
public class DbVariableTable
{
///
/// 主键ID
///
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
///
/// 变量表名称
///
public string Name { get; set; }
///
/// 描述
///
[SugarColumn(IsNullable = true)]
public string Description { get; set; }
///
/// 是否激活
///
public bool IsActive { get; set; }
///
/// 设备ID
///
public int DeviceId { get; set; }
///
/// 关联的设备
///
[SugarColumn(IsIgnore = true)]
public DbDevice DbDevice { get; set; }
///
/// 协议类型
///
[SugarColumn(ColumnDataType="varchar(20)",SqlParameterDbType=typeof(EnumToStringConvert))]
public ProtocolType Protocol { get; set; } // 对应 ProtocolType 枚举
///
/// 此设备包含的变量表集合。
///
[SugarColumn(IsIgnore = true)]
public List Variables { get; set; } = new();
}