intelligentbuildingcontrol.go 1.0 KB

123456789101112131415161718192021222324252627
  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. func (p *Point) TableName() string {
  21. return "point"
  22. }