package dao import "server/global" type WeekConsumptionSummary struct { global.GVA_MODEL GatewayID uint `json:"gatewayID" gorm:"comment:网关ID"` UUID string `json:"UUID" gorm:"comment:灯具UUID,为空代表网关汇总"` Year int `json:"year" gorm:"index;comment:年份"` Week int `json:"week" gorm:"index;comment:第几周"` ActualTotal float64 `json:"actualTotal" gorm:"comment:本周累计实际能耗 度"` TheoryTotal float64 `json:"theoryTotal" gorm:"comment:本周累计理论能耗 度"` } func (WeekConsumptionSummary) TableName() string { return "week_consumption_summary" } func (wcs WeekConsumptionSummary) CreateWeekConsumptionSummary() error { return global.GVA_DB.Create(&wcs).Error }