package stl import ( "time" "github.com/beego/beego/v2/client/orm" ) type CalculateStlConfig struct { CalculateStlConfigId int `orm:"column(calculate_stl_config_id);pk"` Config string `description:"STL计算配置"` SysUserId int `description:"系统用户ID"` CreateTime time.Time `description:"创建时间"` ModifyTime time.Time `description:"更新时间"` } func (c *CalculateStlConfig) Insert() (insertId int64, err error) { o := orm.NewOrmUsingDB("data") insertId, err = o.Insert(c) return } func (c *CalculateStlConfig) Update(cols []string) (err error) { o := orm.NewOrmUsingDB("data") _, err = o.Update(c, cols...) return } func GetCalculateStlConfigById(id int) (item *CalculateStlConfig, err error) { o := orm.NewOrmUsingDB("data") sql := "SELECT * FROM calculate_stl_config WHERE calculate_stl_config_id =?" err = o.Raw(sql, id).QueryRow(&item) return }