|
@@ -2,43 +2,44 @@ package dao
|
|
|
|
|
|
import (
|
|
|
"gorm.io/gorm"
|
|
|
+ "iot_manager_service/util/common"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
|
|
|
type LightControl struct {
|
|
|
- ID int `gorm:"primary_key" json:"id"`
|
|
|
- Name string `gorm:"type:varchar(64)" json:"name"`
|
|
|
- Sn string `gorm:"type:varchar(60)" json:"sn"`
|
|
|
- ControlType int `gorm:"type:int" json:"controlType"`
|
|
|
- GroupId int `gorm:"type:int" json:"groupId"`
|
|
|
- GatewayId int `gorm:"type:varchar(32)" json:"gatewayId"`
|
|
|
- LampPoleId int `gorm:"type:int" json:"lampPoleId"`
|
|
|
- LampPoleName string `gorm:"type:varchar(64)" json:"lampPoleName"`
|
|
|
- LampPoleSn string `gorm:"type:varchar(64)" json:"lampPoleSn"`
|
|
|
- LampPoleLocation string `gorm:"type:varchar(255)" json:"lampPoleLocation"`
|
|
|
- LampLat float64 `gorm:"type:double(17,14)" json:"lampLat"`
|
|
|
- LampLng float64 `gorm:"type:double(17,14)" json:"lampLng"`
|
|
|
- RatedPower float32 `gorm:"type:double(8,2)" json:"ratedPower"`
|
|
|
- BrandId int `gorm:"type:int" json:"brandId"`
|
|
|
- ModelId int `gorm:"type:int" json:"modelId"`
|
|
|
- InstallTime time.Time `gorm:"type:date" json:"installTime"`
|
|
|
- TenantId int `gorm:"type:int" json:"tenantId"`
|
|
|
- CreateTime time.Time `gorm:"type:datetime" json:"createTime"`
|
|
|
- CreateUser int64 `gorm:"type:bigint" json:"createUser"`
|
|
|
- UpdateTime time.Time `gorm:"type:datetime" json:"updateTime"`
|
|
|
- UpdateUser int64 `gorm:"type:bigint" json:"updateUser"`
|
|
|
- IsDeleted int `gorm:"type:int;default 0" json:"isDeleted"`
|
|
|
- Status int `gorm:"type:int" json:"status"`
|
|
|
- Tag string `gorm:"type:varchar(255)" json:"tag"`
|
|
|
- ControlNo string `gorm:"type:varchar(10)" json:"controlNo"`
|
|
|
- ChannelNum int `gorm:"type:int" json:"channelNum"`
|
|
|
- NetworkNum int `gorm:"type:int" json:"networkNum"`
|
|
|
- ZigbeeId int `gorm:"type:int" json:"zigbeeId"`
|
|
|
- ZigbeeName string `gorm:"type:varchar(10)" json:"zigbeeName"`
|
|
|
- ZigbeeSn string `gorm:"type:varchar(10)" json:"zigbeeSn"`
|
|
|
- IsEnable int `gorm:"type:int;default 2" json:"isEnable"`
|
|
|
- IsOnDemand int `gorm:"type:int; default 0" json:"isOnDemand"`
|
|
|
+ ID int `gorm:"primary_key" json:"id"`
|
|
|
+ Name string `gorm:"type:varchar(64)" json:"name"`
|
|
|
+ Sn string `gorm:"type:varchar(60)" json:"sn"`
|
|
|
+ ControlType int `gorm:"type:int" json:"controlType"`
|
|
|
+ GroupId int `gorm:"type:int" json:"groupId"`
|
|
|
+ GatewayId int `gorm:"type:varchar(32)" json:"gatewayId"`
|
|
|
+ LampPoleId int `gorm:"type:int" json:"lampPoleId"`
|
|
|
+ LampPoleName string `gorm:"type:varchar(64)" json:"lampPoleName"`
|
|
|
+ LampPoleSn string `gorm:"type:varchar(64)" json:"lampPoleSn"`
|
|
|
+ LampPoleLocation string `gorm:"type:varchar(255)" json:"lampPoleLocation"`
|
|
|
+ LampLat float64 `gorm:"type:double(17,14)" json:"lampLat"`
|
|
|
+ LampLng float64 `gorm:"type:double(17,14)" json:"lampLng"`
|
|
|
+ RatedPower float32 `gorm:"type:double(8,2)" json:"ratedPower"`
|
|
|
+ BrandId int `gorm:"type:int" json:"brandId"`
|
|
|
+ ModelId int `gorm:"type:int" json:"modelId"`
|
|
|
+ InstallTime common.Time `gorm:"type:date" json:"installTime"`
|
|
|
+ TenantId int `gorm:"type:int" json:"tenantId"`
|
|
|
+ CreateTime time.Time `gorm:"type:datetime" json:"createTime"`
|
|
|
+ CreateUser int64 `gorm:"type:bigint" json:"createUser"`
|
|
|
+ UpdateTime time.Time `gorm:"type:datetime" json:"updateTime"`
|
|
|
+ UpdateUser int64 `gorm:"type:bigint" json:"updateUser"`
|
|
|
+ IsDeleted int `gorm:"type:int;default 0" json:"isDeleted"`
|
|
|
+ Status int `gorm:"type:int" json:"status"`
|
|
|
+ Tag string `gorm:"type:varchar(255)" json:"tag"`
|
|
|
+ ControlNo string `gorm:"type:varchar(10)" json:"controlNo"`
|
|
|
+ ChannelNum int `gorm:"type:int" json:"channelNum"`
|
|
|
+ NetworkNum int `gorm:"type:int" json:"networkNum"`
|
|
|
+ ZigbeeId int `gorm:"type:int" json:"zigbeeId"`
|
|
|
+ ZigbeeName string `gorm:"type:varchar(10)" json:"zigbeeName"`
|
|
|
+ ZigbeeSn string `gorm:"type:varchar(10)" json:"zigbeeSn"`
|
|
|
+ IsEnable int `gorm:"type:int;default 2" json:"isEnable"`
|
|
|
+ IsOnDemand int `gorm:"type:int; default 0" json:"isOnDemand"`
|
|
|
}
|
|
|
|
|
|
func (LightControl) TableName() string {
|