1234567891011121314151617181920212223242526272829303132333435 |
- package model
- import "gorm.io/gorm"
- type IntelligentBuildingControl struct {
- gorm.Model
- }
- func (m *IntelligentBuildingControl) TableName() string {
- return "intelligent_building_control"
- }
- // 点位表
- type Point struct {
- Id int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement;comment:点位ID"`
- FullPath string `json:"full_path" gorm:"column:full_path;type:varchar(255);comment:点位全路径"`
- DeviceType string `json:"device_type" gorm:"column:device_type;type:varchar(50);comment:设备类型"`
- Building string `json:"building" gorm:"column:building;type:varchar(50);comment:所属楼宇ID"`
- Floor string `json:"floor" gorm:"column:floor;type:varchar(50);comment:楼层"`
- Section string `json:"section" gorm:"column:section;type:varchar(50);comment:区域"`
- DeviceName string `json:"device_name" gorm:"column:device_name;type:varchar(100);comment:设备名称"`
- PointName string `json:"point_name" gorm:"column:point_name;type:varchar(100);comment:点位名称"`
- }
- // DeviceType 设备类型对应表
- var DeviceType = map[string]string{
- "JSK": "集水坑",
- "AHU": "空调机组",
- "PAU": "新风机组",
- "EAF": "送排风机",
- }
- func (p *Point) TableName() string {
- return "point"
- }
|