package stl import ( "time" "eta/eta_api/global" "eta/eta_api/utils" ) type CalculateStlConfig struct { CalculateStlConfigId int `orm:"column(calculate_stl_config_id);pk" gorm:"column:calculate_stl_config_id;primaryKey"` Config string `description:"STL计算配置" gorm:"column:config"` SysUserId int `description:"系统用户ID" gorm:"column:sys_user_id"` CreateTime time.Time `description:"创建时间" gorm:"column:create_time"` ModifyTime time.Time `description:"更新时间" gorm:"column:modify_time"` } func (c *CalculateStlConfig) Insert() (insertId int64, err error) { err = global.DbMap[utils.DbNameIndex].Create(c).Error if err != nil { return } insertId = int64(c.CalculateStlConfigId) return } func (c *CalculateStlConfig) Update(cols []string) (err error) { err = global.DbMap[utils.DbNameIndex].Select(cols).Updates(c).Error return } func GetCalculateStlConfigById(id int) (item *CalculateStlConfig, err error) { sql := "SELECT * FROM calculate_stl_config WHERE calculate_stl_config_id =?" err = global.DbMap[utils.DbNameIndex].Raw(sql, id).First(&item).Error return }