intelligentbuildingcontrol.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. func (p *Point) TableName() string {
  28. return "point"
  29. }