将所有的VariableData改为Variable,将DataVariables改为Variables,修复了变量添加MQTT服务器后,服务器列表不更新的问题

This commit is contained in:
2025-07-17 20:13:21 +08:00
parent 6b21c387d5
commit 018fe7c9d0
44 changed files with 410 additions and 407 deletions

View File

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