using PMSWPF.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
namespace PMSWPF.Data.Entities;
///
/// 表示数据库中的变量表实体。
///
[SugarTable("VariableTable")]
public class DbVariableTable
{
///
/// 变量表中包含的数据变量列表。
///
[Navigate(NavigateType.OneToMany, nameof(DbVariable.VariableTableId))]
public List? Variables { get; set; }
///
/// 变量表关联的设备。
///
[Navigate(NavigateType.ManyToOne, nameof(DeviceId))]
public DbDevice? Device { get; set; }
///
/// 变量表关联的设备ID。
///
[SugarColumn(IsNullable = true)]
public int? DeviceId { get; set; }
///
/// 变量表描述。
///
[SugarColumn(IsNullable = true)]
public string? Description { get; set; }
///
/// 变量表的唯一标识符。
///
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)] //数据库是自增才配自增
public int Id { get; set; }
///
/// 表示变量表是否处于活动状态。
///
public bool IsActive { get; set; }
///
/// 变量表名称。
///
public string Name { get; set; }
///
/// 变量表使用的协议类型。
///
[SugarColumn(ColumnDataType = "varchar(20)", SqlParameterDbType = typeof(EnumToStringConvert))]
public ProtocolType ProtocolType { get; set; }
}