123456789101112131415161718192021222324 |
- package dao
- import "time"
- type LightCondition struct {
- ID int `gorm:"primary key" json:"id"` //编号
- LightId int `gorm:"type: int" json:"lightId"` //照明策略id
- ScopeStart int `gorm:"type:int" json:"scopeStart"` //光照度范围开始值
- ScopeEnd int `gorm:"type: int" json:"scopeEnd"` //光照度范围结束值
- Luminance int `gorm:"type:int " json:"luminance"` //开灯亮度
- Remark string `gorm:"type:varchar(255)" json:"remark"` //备注
- CreateTime time.Time `gorm:"type: datetime" json:"createTime"` //新增时间
- CreateUser string `gorm:"type:varchar(60)" json:"createUser"` //新增记录操作用户ID
- UpdateTime time.Time `gorm:"type: datetime" json:"updateTime"` //修改时间
- UpdateUser string `gorm:"type:varchar(60)" json:"updateUser"` //修改用户
- IsDeleted int `gorm:"type:int;default 0" json:"isDeleted"` //是否删除 0=未删除,1=删除
- }
- func (LightCondition) TableName() string {
- return "t_strategy_light_condition"
- }
- func (c *LightCondition) Get() error {
- return Db.Model(&c).Where("id = ?", c.ID).Find(&c).Error
- }
|