using System;
using SqlSugar;
namespace PMSWPF.Data.Entities;
///
/// 表示数据库中的变量数据历史实体。
///
[SugarTable("VarDataHistory")]
public class DbVariableHistory
{
///
/// 历史记录唯一标识符。
///
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
///
/// 变量名称。
///
public string Name { get; set; }
///
/// 节点ID,用于标识变量在设备或系统中的唯一路径。
///
[SugarColumn(IsNullable = true)]
public string NodeId { get; set; } = String.Empty;
///
/// 变量当前原始数据值。
///
public string DataValue { get; set; } = String.Empty;
///
/// 关联的DbVariableData的ID。
///
public int VariableId { get; set; }
///
/// 关联的DbVariableData实体。
///
[Navigate(NavigateType.ManyToOne, nameof(VariableId))]
public DbVariable? Variable { get; set; }
///
/// 历史记录的时间戳。
///
public DateTime Timestamp { get; set; } = DateTime.Now;
}