2025-06-20 18:53:29 +08:00
|
|
|
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-23 17:01:06 +08:00
|
|
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)] //数据库是自增才配自增
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2025-06-10 22:13:06 +08:00
|
|
|
public string Name { get; set; }
|
2025-06-23 17:01:06 +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-23 17:01:06 +08:00
|
|
|
|
|
|
|
|
[SugarColumn(ColumnDataType = "varchar(20)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
2025-06-20 18:53:29 +08:00
|
|
|
public DeviceType DeviceType { get; set; }
|
2025-06-23 17:01:06 +08:00
|
|
|
|
|
|
|
|
[Navigate(NavigateType.OneToMany, nameof(DbVariableTable.DeviceId))]
|
2025-06-20 18:53:29 +08:00
|
|
|
[SugarColumn(IsNullable = true)]
|
2025-06-23 17:01:06 +08:00
|
|
|
public List<DbVariableTable>? VariableTables { get; set; }
|
|
|
|
|
|
|
|
|
|
[SugarColumn(ColumnDataType = "varchar(20)", SqlParameterDbType = typeof(EnumToStringConvert))]
|
2025-06-20 18:53:29 +08:00
|
|
|
public ProtocolType ProtocolType { get; set; }
|
2025-06-10 22:13:06 +08:00
|
|
|
}
|