calculate_stl_config.go 950 B

12345678910111213141516171819202122232425262728293031323334
  1. package stl
  2. import (
  3. "time"
  4. "github.com/beego/beego/v2/client/orm"
  5. )
  6. type CalculateStlConfig struct {
  7. CalculateStlConfigId int `orm:"column(calculate_stl_config_id);pk"`
  8. Config string `description:"STL计算配置"`
  9. SysUserId int `description:"系统用户ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. ModifyTime time.Time `description:"更新时间"`
  12. }
  13. func (c *CalculateStlConfig) Insert() (insertId int64, err error) {
  14. o := orm.NewOrmUsingDB("data")
  15. insertId, err = o.Insert(c)
  16. return
  17. }
  18. func (c *CalculateStlConfig) Update(cols []string) (err error) {
  19. o := orm.NewOrmUsingDB("data")
  20. _, err = o.Update(c, cols...)
  21. return
  22. }
  23. func GetCalculateStlConfigById(id int) (item *CalculateStlConfig, err error) {
  24. o := orm.NewOrmUsingDB("data")
  25. sql := "SELECT * FROM calculate_stl_config WHERE calculate_stl_config_id =?"
  26. err = o.Raw(sql, id).QueryRow(&item)
  27. return
  28. }