2025-06-22 21:00:06 +08:00
|
|
|
using System.Collections.ObjectModel;
|
2025-06-20 18:53:29 +08:00
|
|
|
using System.Net.Sockets;
|
|
|
|
|
using PMSWPF.Enums;
|
2025-06-12 18:41:46 +08:00
|
|
|
using SqlSugar;
|
2025-06-20 18:53:29 +08:00
|
|
|
using SqlSugar.DbConvert;
|
|
|
|
|
using ProtocolType = PMSWPF.Enums.ProtocolType;
|
2025-06-12 18:41:46 +08:00
|
|
|
|
2025-06-10 22:13:06 +08:00
|
|
|
namespace PMSWPF.Data.Entities;
|
|
|
|
|
|
2025-06-12 18:41:46 +08:00
|
|
|
[SugarTable("Device")]
|
2025-06-10 22:13:06 +08:00
|
|
|
public class DbDevice
|
|
|
|
|
{
|
2025-06-12 18:41:46 +08:00
|
|
|
|
|
|
|
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//数据库是自增才配自增
|
2025-06-10 22:13:06 +08:00
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
2025-06-20 18:53:29 +08:00
|
|
|
[SugarColumn(IsNullable = true)]
|
|
|
|
|
public string? Description { get; set; }
|
2025-06-12 18:41:46 +08:00
|
|
|
public string Ip { get; set; }
|
2025-06-10 22:13:06 +08:00
|
|
|
public bool IsActive { get; set; }
|
|
|
|
|
public bool IsRuning { get; set; }
|
2025-06-20 18:53:29 +08:00
|
|
|
[SugarColumn(ColumnDataType="varchar(20)",SqlParameterDbType=typeof(EnumToStringConvert))]
|
|
|
|
|
public DeviceType DeviceType { get; set; }
|
|
|
|
|
|
|
|
|
|
[Navigate(NavigateType.OneToMany, nameof(DbVariableTable.DeviceId))]
|
|
|
|
|
[SugarColumn(IsNullable = true)]
|
|
|
|
|
public List<DbVariableTable>? VariableTables { get; set; }
|
|
|
|
|
[SugarColumn(ColumnDataType="varchar(20)",SqlParameterDbType=typeof(EnumToStringConvert))]
|
|
|
|
|
public ProtocolType ProtocolType { get; set; }
|
2025-06-10 22:13:06 +08:00
|
|
|
|
|
|
|
|
}
|