ref: v3变更,,同步v2.2508.4

This commit is contained in:
TsMask
2025-09-01 11:15:32 +08:00
parent 86dd22c274
commit 382bc311e6
198 changed files with 3768 additions and 3257 deletions

View File

@@ -22,8 +22,11 @@ func (r NeConfigBackup) SelectByPage(query map[string]string) ([]model.NeConfigB
if v, ok := query["neType"]; ok && v != "" {
tx = tx.Where("ne_type = ?", v)
}
if v, ok := query["neId"]; ok && v != "" {
tx = tx.Where("ne_id = ?", v)
if v, ok := query["coreUid"]; ok && v != "" {
tx = tx.Where("core_uid = ?", v)
}
if v, ok := query["neUid"]; ok && v != "" {
tx = tx.Where("ne_uid = ?", v)
}
if v, ok := query["name"]; ok && v != "" {
tx = tx.Where("name like ?", fmt.Sprintf("%%%s%%", v))
@@ -49,6 +52,32 @@ func (r NeConfigBackup) SelectByPage(query map[string]string) ([]model.NeConfigB
return rows, total
}
// Select 查询集合
func (r NeConfigBackup) Select(param model.NeConfigBackup) []model.NeConfigBackup {
tx := db.DB("").Model(&model.NeConfigBackup{})
// 查询条件拼接
if param.CoreUID != "" {
tx = tx.Where("core_uid = ?", param.CoreUID)
}
if param.NeUID != "" {
tx = tx.Where("ne_uid = ?", param.NeUID)
}
if param.NeType != "" {
tx = tx.Where("ne_type = ?", param.NeType)
}
if param.CreateBy != "" {
tx = tx.Where("create_by like ?", fmt.Sprintf("%s%%", param.CreateBy))
}
// 查询数据
rows := []model.NeConfigBackup{}
if err := tx.Find(&rows).Error; err != nil {
logger.Errorf("query find err => %v", err.Error())
return rows
}
return rows
}
// SelectByIds 通过ID查询信息
func (r NeConfigBackup) SelectByIds(ids []int64) []model.NeConfigBackup {
rows := []model.NeConfigBackup{}