edb_import_fail.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. import (
  3. "eta_gn/eta_api/global"
  4. )
  5. type EdbImportFail struct {
  6. Id int `gorm:"column:id;primaryKey"` //`orm:"column(id);pk" gorm:"primaryKey" `
  7. ClassifyName string `gorm:"column:classify_name"`
  8. Frequency string `gorm:"column:frequency"`
  9. SecName string `gorm:"column:sec_name"`
  10. Unit string `gorm:"column:unit"`
  11. Remark string `gorm:"column:remark"`
  12. SysUserId string `gorm:"column:sys_user_id"`
  13. }
  14. func AddEdbImportFail(item *EdbImportFail) (err error) {
  15. err = global.DmSQL["edb"].Create(item).Error
  16. return err
  17. }
  18. // DelEdbImportFail 删除导入失败记录
  19. func DelEdbImportFail(userId int) (err error) {
  20. sql := `delete from edb_import_fail where sys_user_id=?`
  21. err = global.DmSQL["edb"].Exec(sql, userId).Error
  22. return err
  23. }
  24. // GetEdbImportFailList 获取指标数据导入失败数据
  25. func GetEdbImportFailList(sysUserId int) (items []*EdbImportFail, err error) {
  26. sql := ` SELECT * FROM edb_import_fail WHERE sys_user_id=? `
  27. err = global.DmSQL["edb"].Raw(sql, sysUserId).Find(&items).Error
  28. return
  29. }