using SqlSugar;

namespace YBDevice.Entity
{
    /// <summary>
    /// 设备表
    /// </summary>
    [SugarTable("YB_Device", TableDescription = "设备表", IsDisabledUpdateAll = false, IsDisabledDelete = true)]
    public class YB_Device
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public System.Int32 Id { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        [SugarColumn(ColumnDescription = "设备名称", ColumnDataType = "nvarchar(100)")]
        public System.String Name { get; set; }

        /// <summary>
        /// 设备序列号,唯一
        /// </summary>
        [SugarColumn(ColumnDescription = "设备序列号,唯一", ColumnDataType = "varchar(50)")]
        public System.String FacCode { get; set; }

        /// <summary>
        /// 设备机器码,唯一
        /// </summary>
        [SugarColumn(ColumnDescription = " 设备机器码,唯一", ColumnDataType = "varchar(50)")]
        public System.String Ecode { get; set; }

        /// <summary>
        /// 设备类型,参考YB_DeviceType表
        /// </summary>
        [SugarColumn(ColumnDescription = "设备类型,参考YB_DeviceType表")]
        public System.Int32 Type { get; set; }

        /// <summary>
        /// 所属客户ID
        /// </summary>
        [SugarColumn(ColumnDescription = "所属客户ID")]
        public System.Int32 BusinessId { get; set; }

        /// <summary>
        /// 设备状态,0-停止运行,1-正常运行,2-待激活
        /// </summary>
        [SugarColumn(ColumnDescription = "设备状态,0-停止运行,1-正常运行,2-待激活")]
        public DeviceStatus Status { get; set; }

        /// <summary>
        /// 激活时间
        /// </summary>
        [SugarColumn(ColumnDescription = "激活时间", IsNullable =true)]
        public System.DateTime? ActiveTime { get; set; }

        /// <summary>
        /// 到期时间
        /// </summary>
        [SugarColumn(ColumnDescription = "到期时间", IsNullable =true)]
        public System.DateTime? EndTime { get; set; }

        /// <summary>
        /// 最近测量时间
        /// </summary>
        [SugarColumn(ColumnDescription = "最近测量时间", IsNullable =true)]
        public System.DateTime? LastHeartTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注编码", ColumnDataType = "nvarchar(200)")]
        public System.String Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间")]
        public System.DateTime CreateTime { get; set; }

        /// <summary>
        /// 出厂绑定的客户ID
        /// </summary>
        [SugarColumn(ColumnDescription = "出厂绑定的客户ID",DefaultValue ="0")]
        public System.Int32 BindBusinessId { get; set; }
    }
}
