edb_import_fail.go 964 B

1234567891011121314151617181920212223242526272829303132
  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. func DelEdbImportFail(userId int) (err error) {
  19. sql := `delete from edb_import_fail where sys_user_id=?`
  20. err = global.DmSQL["edb"].Exec(sql, userId).Error
  21. return err
  22. }
  23. func GetEdbImportFailList(sysUserId int) (items []*EdbImportFail, err error) {
  24. sql := ` SELECT * FROM edb_import_fail WHERE sys_user_id=? `
  25. err = global.DmSQL["edb"].Raw(sql, sysUserId).Find(&items).Error
  26. return
  27. }