edb_python_code.go 892 B

12345678910111213141516171819202122232425262728293031
  1. package data_manage
  2. import (
  3. "eta_gn/eta_api/global"
  4. "time"
  5. )
  6. // EdbPythonCode python指标运算代码
  7. type EdbPythonCode struct {
  8. EdbPythonCodeId int `orm:"column(edb_python_code_id);pk" gorm:"primaryKey" `
  9. EdbInfoId int `description:"指标id"`
  10. EdbCode string `description:"指标编码"`
  11. PythonCode string `description:"python代码"`
  12. ModifyTime time.Time
  13. CreateTime time.Time
  14. }
  15. // Update 更新EdbPythonCode信息
  16. func (edbPythonCode *EdbPythonCode) Update(cols []string) (err error) {
  17. err = global.DmSQL["data"].Select(cols).Updates(edbPythonCode).Error
  18. return
  19. }
  20. // GetEdbPythonCodeById 根据指标id获取python代码
  21. func GetEdbPythonCodeById(edbInfoId int) (item *EdbPythonCode, err error) {
  22. sql := ` SELECT * FROM edb_python_code WHERE edb_info_id=? `
  23. err = global.DmSQL["data"].Raw(sql, edbInfoId).First(&item).Error
  24. return
  25. }