edbdata_import_fail.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package models
  2. import (
  3. "eta/eta_api/utils"
  4. "github.com/beego/beego/v2/client/orm"
  5. )
  6. type EdbdataImportFail struct {
  7. Id int `orm:"column(id);pk"`
  8. ClassifyName string
  9. CreateDate string
  10. SecName string
  11. Close string
  12. Remark string
  13. SysUserId string
  14. Frequency string
  15. Unit string
  16. }
  17. func AddEdbdataImportFail(item *EdbdataImportFail) (err error) {
  18. o := orm.NewOrmUsingDB("edb")
  19. _, err = o.Insert(item)
  20. return err
  21. }
  22. // MultiAddEdbdataImportFail
  23. // @Description: 批量添加导入失败的信息
  24. // @author: Roc
  25. // @datetime 2024-07-30 19:48:06
  26. // @param items []*EdbdataImportFail
  27. // @return err error
  28. func MultiAddEdbdataImportFail(items []*EdbdataImportFail) (err error) {
  29. o := orm.NewOrmUsingDB("edb")
  30. _, err = o.InsertMulti(utils.MultiAddNum, items)
  31. return err
  32. }
  33. // DelEdbDataImportFail 删除导入指标失败记录
  34. func DelEdbDataImportFail(userId int) (err error) {
  35. o := orm.NewOrmUsingDB("edb")
  36. sql := `delete from edbdata_import_fail where sys_user_id=?`
  37. _, err = o.Raw(sql, userId).Exec()
  38. return err
  39. }