123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package models
- import (
- "eta_gn/eta_api/global"
- "eta_gn/eta_api/utils"
- )
- type EdbdataImportFail struct {
- Id int `gorm:"column:id;primaryKey;autoIncrement" description:"主键ID"`
- ClassifyName string `gorm:"column:classify_name" description:"分类名称"`
- CreateDate string `gorm:"column:create_date" description:"创建日期"`
- SecName string `gorm:"column:sec_name" description:"部门名称"`
- Close string `gorm:"column:close" description:"关闭状态"`
- Remark string `gorm:"column:remark" description:"备注"`
- SysUserId string `gorm:"column:sys_user_id" description:"系统用户ID"`
- Frequency string `gorm:"column:frequency" description:"频率"`
- Unit string `gorm:"column:unit" description:"单位"`
- }
- func AddEdbdataImportFail(item *EdbdataImportFail) (err error) {
- //o := orm.NewOrmUsingDB("edb")
- //_, err = o.Insert(item)
- err = global.DmSQL["edb"].Create(item).Error
- //return err
- return
- }
- // MultiAddEdbdataImportFail
- // @Description: 批量添加导入失败的信息
- // @author: Roc
- // @datetime 2024-07-30 19:48:06
- // @param items []*EdbdataImportFail
- // @return err error
- func MultiAddEdbdataImportFail(items []*EdbdataImportFail) (err error) {
- //o := orm.NewOrmUsingDB("edb")
- //_, err = o.InsertMulti(utils.MultiAddNum, items)
- err = global.DmSQL["edb"].CreateInBatches(items, utils.MultiAddNum).Error
- return err
- }
- // DelEdbDataImportFail 删除导入指标失败记录
- func DelEdbDataImportFail(userId int) (err error) {
- //o := orm.NewOrmUsingDB("edb")
- sql := `delete from edbdata_import_fail where sys_user_id=?`
- //_, err = o.Raw(sql, userId).Exec()
- err = global.DmSQL["edb"].Exec(sql, userId).Error
- return err
- }
|