edb_import_fail.go 914 B

1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type EdbImportFail struct {
  4. Id int `orm:"column(id);pk"`
  5. ClassifyName string
  6. Frequency string
  7. SecName string
  8. Unit string
  9. Remark string
  10. SysUserId string
  11. }
  12. func AddEdbImportFail(item *EdbImportFail) (err error) {
  13. o := orm.NewOrmUsingDB("edb")
  14. _, err = o.Insert(item)
  15. return err
  16. }
  17. // DelEdbImportFail 删除导入失败记录
  18. func DelEdbImportFail(userId int) (err error) {
  19. o := orm.NewOrmUsingDB("edb")
  20. sql := `delete from edb_import_fail where sys_user_id=?`
  21. _, err = o.Raw(sql, userId).Exec()
  22. return err
  23. }
  24. // GetEdbImportFailList 获取指标数据导入失败数据
  25. func GetEdbImportFailList(sysUserId int) (items []*EdbImportFail, err error) {
  26. o := orm.NewOrmUsingDB("edb")
  27. sql := ` SELECT * FROM edb_import_fail WHERE sys_user_id=? `
  28. _, err = o.Raw(sql, sysUserId).QueryRows(&items)
  29. return
  30. }