1234567891011121314151617181920212223242526272829303132333435363738 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- // EdbPythonCode python指标运算代码
- type EdbPythonCode struct {
- EdbPythonCodeId int `orm:"column(edb_python_code_id);pk"`
- EdbInfoId int `description:"指标id"`
- EdbCode string `description:"指标编码"`
- PythonCode string `description:"python代码"`
- ModifyTime time.Time
- CreateTime time.Time
- }
- // Update 更新EdbPythonCode信息
- func (edbPythonCode *EdbPythonCode) Update(cols []string) (err error) {
- o := orm.NewOrm()
- _, err = o.Update(edbPythonCode, cols...)
- return
- }
- // AddEdbPythonCode python指标运算代码
- func AddEdbPythonCode(item *EdbPythonCode) (lastId int64, err error) {
- o := orm.NewOrm()
- lastId, err = o.Insert(item)
- return
- }
- // GetEdbPythonCodeById 根据指标id获取python代码
- func GetEdbPythonCodeById(edbInfoId int) (item *EdbPythonCode, err error) {
- o := orm.NewOrm()
- sql := ` SELECT * FROM edb_python_code WHERE edb_info_id=? `
- err = o.Raw(sql, edbInfoId).QueryRow(&item)
- return
- }
|