Base_EquipmentProp.cs
2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using System.Text.Json.Serialization;
namespace RCS.Model.Entity
{
[Table("t_base_equipmentprop")]
public class Base_EquipmentProp
{
/// <summary>
/// 主键
/// </summary>
[Key]
[Column(Order = 1)]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
/// <summary>
/// 设备属性编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 设备属性名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 设备编码
/// </summary>
public string EquipmentCode { get; set; }
/// <summary>
/// 设备属性地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 数据占用的字节数
/// </summary>
public ushort ByteSize { get; set; }
/// <summary>
/// 设备属性值
/// </summary>
public string Value { get; set; }
/// <summary>
/// 设备属性数据类型
/// </summary>
public string DataType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime Updated { get; set; }
/// <summary>
/// 修改人
/// </summary>
public string UpdatedBy { get; set; }
public override string ToString()
{
var sb = new StringBuilder();
sb.Append(EquipmentCode);
sb.Append('-');
sb.Append(Name);
sb.Append(':');
sb.Append(Value);
return sb.ToString();
}
#region 扩展属性
/// <summary>
/// 批量操作时候的设备属性地址
/// </summary>
[NotMapped]
public string BatchAddress { get; set; }
/// <summary>
/// 位偏移,相对于读取bit而言,取值为0到7,其他类型为0
/// </summary>
[NotMapped]
public int BitOffset { get; set; }
/// <summary>
/// 设备编码
/// </summary>
[NotMapped]
public string EquipmentName { get; set; }
/// <summary>
/// 逻辑外键--设备实体
/// </summary>
[NotMapped]
[JsonIgnore]
public Base_Equipment Equipment { get; set; }
#endregion
}
}