gatewayRelationDao.go 1.5 KB

12345678910111213141516171819202122232425262728
  1. package dao
  2. import "time"
  3. //GatewayRelation 网关挂载设备关联信息表
  4. type GatewayRelation struct {
  5. ID int `gorm:"type:int;primary_key"` //编号 网关ID
  6. LightControlCount int `gorm:"type:int;default 0"` //灯控数量
  7. InfoBoardCount int `gorm:"type:int;default 0"` //信息屏数量
  8. OptoSensorCount int `gorm:"type:int;default 0"` //环境传感器数量
  9. ZigbeeCount int `gorm:"type:int;default 0"` //Zigbee设备数量
  10. AlarmTerminalCount int `gorm:"type:int;default 0"` //告警终端数量
  11. CaptureUnitCount int `gorm:"type:int;default 0"` //抓拍单元数量
  12. IpBroadcastCount int `gorm:"type:int;default 0"` //IP音柱数量
  13. Total int `gorm:"type:int;default 0"` //总数
  14. TenantId string `gorm:"type:varchar(12)" json:"tenantId"` //租户ID
  15. CreateTime time.Time `gorm:"type:datetime" json:"createTime"` //新增时间
  16. UpdateTime time.Time `gorm:"type:datetime" json:"updateTime"` //修改时间
  17. IsDeleted int `gorm:"type:int;default 0" json:"isDeleted"` //是否删除 0=未删除,1=删
  18. }
  19. func (GatewayRelation) TableName() string {
  20. return "t_dev_gateway_relation"
  21. }
  22. func (c *GatewayRelation) Get() error {
  23. return GDb.Model(&c).Where("id = ?", c.ID).Find(&c).Error
  24. }