edb_data_insert_config.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // EdbDataInsertConfig 指标数据插入配置表
  7. type EdbDataInsertConfig struct {
  8. EdbInfoId int `orm:"column(edb_info_id);pk" description:"指标id"`
  9. Date time.Time `description:"插入的日期"`
  10. Value string `description:"插入的值"`
  11. RealDate time.Time `description:"实际数据的日期"`
  12. ModifyTime time.Time `description:"数据更新时间"`
  13. CreateTime time.Time `description:"数据插入的时间"`
  14. }
  15. // GetEdbDataInsertConfigByEdbId 根据指标id 获取数据插入配置详情
  16. func GetEdbDataInsertConfigByEdbId(edbInfoId int) (item *EdbDataInsertConfig, err error) {
  17. o := orm.NewOrm()
  18. sql := ` SELECT * FROM edb_data_insert_config WHERE edb_info_id=? `
  19. err = o.Raw(sql, edbInfoId).QueryRow(&item)
  20. return
  21. }
  22. // DeleteEdbDataInsertConfigByEdbId 根据指标id 删除数据插入配置详情
  23. func DeleteEdbDataInsertConfigByEdbId(edbInfoId int) (err error) {
  24. o := orm.NewOrm()
  25. sql := ` DELETE FROM edb_data_insert_config WHERE edb_info_id=? `
  26. _, err = o.Raw(sql, edbInfoId).Exec()
  27. return
  28. }
  29. // GetEdbDataInsertConfigByEdbIdWithTo 根据指标id 获取数据插入配置详情
  30. func GetEdbDataInsertConfigByEdbIdWithTo(to orm.TxOrmer, edbInfoId int) (item *EdbDataInsertConfig, err error) {
  31. sql := ` SELECT * FROM edb_data_insert_config WHERE edb_info_id=? `
  32. err = to.Raw(sql, edbInfoId).QueryRow(&item)
  33. return
  34. }