using Dlhis.DataPermission.Model; using Dlhis.Entity.Device.Enums; using Kurisu.AspNetCore.DataAccess.Entity; using Kurisu.AspNetCore.DataAccess.SqlSugar; using Mapster; using SqlSugar; using SqlSugar.DbConvert; namespace Dlhis.Entity.Basic.Entity; /// /// 设备 /// [SugarTable(TableName = "Device", TableDescription = "设备表")] public class DeviceEntity : SugarBaseEntity, ITenantId { /// /// 设备code /// [DeviceCode] [SugarColumn(IsNullable = false, ColumnDescription = "设备code")] public Guid Code { get; set; } /// /// 设备唯一码,IP/MAC/SNO /// [AdaptIgnore(MemberSide.Destination)] [SugarColumn(IsNullable = false, ColumnDescription = "设备唯一码", UniqueGroupNameList = new[] { "Idx_Device_UniqueNo" })] public string UniqueNo { get; set; } /// /// 心跳间隔 /// [SugarColumn(IsNullable = false, ColumnDescription = "心跳检查间隔")] public int HeartbeatInterval { get; set; } = 30; /// /// 供应商 /// [SugarColumn(IsNullable = true, ColumnDescription = "供应商")] public string Supplier { get; set; } /// /// 设备功能 /// [SugarColumn(IsNullable = false, ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")] public List Funcs { get; set; } /// /// 设备类型 /// [SugarColumn(IsNullable = false, ColumnDescription = "设备类型", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public DeviceTypeEnumType Type { get; set; } /// /// 部署点 /// [SugarColumn(IsNullable = true, ColumnDescription = "部署点")] public string DeployPlace { get; set; } /// /// 部署坐标 /// [SugarColumn(IsNullable = true, ColumnDescription = "部署坐标")] public string DeployPosition { get; set; } /// /// 部署方向 /// [SugarColumn(IsNullable = true, ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public DeviceDeployDirectionEnumType? DeployDirection { get; set; } /// /// 模板code /// [SugarColumn(IsNullable = false, ColumnDescription = "模板code")] public Guid TemplateCode { get; set; } /// /// 连接信息 /// [SugarColumn(IsNullable = false, ColumnDescription = "连接信息")] public string ConnectionInfo { get; set; } /// /// 是否启用 /// [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否启用")] public bool Enable { get; set; } /// /// 是否作为考勤设备 /// [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否作为考勤设备")] public bool AsAttendance { get; set; } /// /// 是否启用时段码 /// [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否启用时段码", DefaultValue = "0")] public bool EnableTimePeriod { get; set; } = false; /// /// 是否为电梯门禁设备 /// [SugarColumn(IsNullable = false, ColumnDataType = "bit", ColumnDescription = "是否为电梯门禁设备", DefaultValue = "0")] public bool IsElevatorAcs { get; set; } public string TenantId { get; set; } }