intelligentbuildingcontrol.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package model
  2. import "gorm.io/gorm"
  3. type IntelligentBuildingControl struct {
  4. gorm.Model
  5. }
  6. func (m *IntelligentBuildingControl) TableName() string {
  7. return "intelligent_building_control"
  8. }
  9. // 点位表
  10. type Point struct {
  11. Id int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement;comment:点位ID"`
  12. FullPath string `json:"full_path" gorm:"column:full_path;type:varchar(255);comment:点位全路径"`
  13. DeviceType string `json:"device_type" gorm:"column:device_type;type:varchar(50);comment:设备类型"`
  14. Building string `json:"building" gorm:"column:building;type:varchar(50);comment:所属楼宇ID"`
  15. Floor string `json:"floor" gorm:"column:floor;type:varchar(50);comment:楼层"`
  16. Section string `json:"section" gorm:"column:section;type:varchar(50);comment:区域"`
  17. DeviceName string `json:"device_name" gorm:"column:device_name;type:varchar(100);comment:设备名称"`
  18. PointName string `json:"point_name" gorm:"column:point_name;type:varchar(100);comment:点位名称"`
  19. }
  20. // DeviceType 设备类型对应表
  21. var DeviceType = map[string]string{
  22. "JSK": "集水坑",
  23. "AHU": "空调机组",
  24. "PAU": "新风机组",
  25. "EAF": "送排风机",
  26. }
  27. // NumericPoint TempS1
  28. type NumericPoint struct {
  29. Val float64 `xml:"val,attr"`
  30. Href string `xml:"href,attr,omitempty"`
  31. Is string `xml:"is,attr,omitempty"`
  32. Display string `xml:"display,attr,omitempty"`
  33. Icon string `xml:"icon,attr,omitempty"`
  34. Unit string `xml:"unit,attr,omitempty"`
  35. Facets *Facets `xml:"str"`
  36. ProxyExt *ProxyExt `xml:"ref"`
  37. Out *OutputValue `xml:"real[name=out]"`
  38. Tag *TagReference `xml:"ref[name=tag]"`
  39. }
  40. type Facets struct {
  41. Name string `xml:"name,attr"`
  42. Val string `xml:"val,attr"`
  43. Href string `xml:"href,attr,omitempty"`
  44. Display string `xml:"display,attr,omitempty"`
  45. DisplayName string `xml:"displayName,attr,omitempty"`
  46. }
  47. type ProxyExt struct {
  48. Name string `xml:"name,attr"`
  49. Href string `xml:"href,attr,omitempty"`
  50. Is string `xml:"is,attr,omitempty"`
  51. Display string `xml:"display,attr,omitempty"`
  52. DisplayName string `xml:"displayName,attr,omitempty"`
  53. Icon string `xml:"icon,attr,omitempty"`
  54. }
  55. type OutputValue struct {
  56. Name string `xml:"name,attr"`
  57. Val float64 `xml:"val,attr"`
  58. Href string `xml:"href,attr,omitempty"`
  59. Is string `xml:"is,attr,omitempty"`
  60. Display string `xml:"display,attr,omitempty"`
  61. DisplayName string `xml:"displayName,attr,omitempty"`
  62. Icon string `xml:"icon,attr,omitempty"`
  63. Unit string `xml:"unit,attr,omitempty"`
  64. }
  65. type TagReference struct {
  66. Name string `xml:"name,attr"`
  67. Href string `xml:"href,attr,omitempty"`
  68. Is string `xml:"is,attr,omitempty"`
  69. Display string `xml:"display,attr,omitempty"`
  70. Icon string `xml:"icon,attr,omitempty"`
  71. }
  72. //TempS1 end
  73. func (p *Point) TableName() string {
  74. return "point"
  75. }