设备类添加产品字段、添加物模型类,新增产品CRUD方法
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Model.Entity.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 物模型点(属性/指令通用表;通过 OwnerType+OwnerId 归属产品或设备)
|
||||
/// 一条点 = 一个寄存器/线圈映射;可写点即"下发指令"的入口
|
||||
/// </summary>
|
||||
public class ThingModelPointEntity : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 归属类型(1=产品 2=设备)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "归属类型")]
|
||||
public ThingOwnerTypeEnum OwnerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 归属对象Id(ProductEntity.Id / IotDeviceEntity.Id)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "归属对象Id")]
|
||||
public long OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 点编码(同一归属内唯一,如 TempPV)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "点编码", Length = 64)]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 点名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "点名称", Length = 100, IsNullable = true)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 寄存器类型(线圈/保持寄存器/输入寄存器)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "寄存器类型")]
|
||||
public ThingRegisterTypeEnum RegisterType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 读写权限
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "读写权限")]
|
||||
public ThingRwEnum Rw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据类型")]
|
||||
public ThingDataTypeEnum DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 寄存器起始地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "寄存器起始地址")]
|
||||
public ushort Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 换算系数(工程值 = 寄存器原始值 / Scale + Offset,对应驱动内 SCALE)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "换算系数", DecimalDigits = 4)]
|
||||
public double Scale { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 偏移量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "偏移量", DecimalDigits = 4)]
|
||||
public double Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "单位", Length = 16, IsNullable = true)]
|
||||
public string? Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否启用")]
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序号")]
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user