gl_data.go 609 B

123456789101112131415161718192021
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type GlIndex struct {
  6. Id int `orm:"column(ID)"`
  7. IndexCode string `orm:"column(INDEX_CODE)"`
  8. IndexName string `orm:"column(INDEX_NAME)"`
  9. UnitName string `orm:"column(UNIT_NAME)"`
  10. FrequencyName string `orm:"column(FREQUENCY_NAME)"`
  11. UpdateTime string `orm:"column(UPDATE_TIME)"`
  12. }
  13. func GetGlIndexByCode(indexCode string) (items *GlIndex, err error) {
  14. sql := ` SELECT * FROM mb_index_main_info WHERE INDEX_CODE=? `
  15. o := orm.NewOrmUsingDB("gl")
  16. err = o.Raw(sql, indexCode).QueryRow(&items)
  17. return
  18. }