using PMSWPF.Enums; using SqlSugar; using SqlSugar.DbConvert; namespace PMSWPF.Data.Entities { public class DbPLC { [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//数据库是自增才配自增 public int id { get; set; } /// /// PLC名称 /// public string Name { get; set; } /// /// PLC品牌 /// /// //新版本:存储字符串 SqlSugar 5.1.4.66-preview02 [SugarColumn(ColumnDataType = "varchar(30)", SqlParameterDbType = typeof(EnumToStringConvert))] public PlcBrand PlcBrand { get; set; } /// /// PLC类型 /// public int CpuType { get; set; } /// /// PLC节点ID /// public string NodeID { get; set; } /// /// PLC IP地址 /// public string IP { get; set; } /// /// PLC状态 /// public string Status { get; set; } /// /// PLC连接类型 /// public string ConnType { get; set; } /// /// PLC连接时间 /// public DateTime ConnTime { get; set; } /// /// 是否启用 /// public bool IsEnable { get; set; } public DbPLC() { } public DbPLC(string name = "", string nodeID = "", string ip = "", string status = "", string connType = "") { this.Name = name; this.NodeID = nodeID; this.IP = ip; this.Status = status; this.ConnType = connType; this.ConnTime = DateTime.Now; } } }