fix: 网元信令跟踪网元类型模糊查询
This commit is contained in:
@@ -32,6 +32,9 @@ func (r TraceTask) SelectByPage(query map[string]string) ([]model.TraceTask, int
|
|||||||
if v, ok := query["title"]; ok && v != "" {
|
if v, ok := query["title"]; ok && v != "" {
|
||||||
tx = tx.Where("title like ?", fmt.Sprintf("%s%%", v))
|
tx = tx.Where("title like ?", fmt.Sprintf("%s%%", v))
|
||||||
}
|
}
|
||||||
|
if v, ok := query["neType"]; ok && v != "" {
|
||||||
|
tx = tx.Where("ne_list like ?", fmt.Sprintf("%%%s%%", strings.ToUpper(v)))
|
||||||
|
}
|
||||||
if v, ok := query["startTime"]; ok && v != "" {
|
if v, ok := query["startTime"]; ok && v != "" {
|
||||||
if len(v) == 10 {
|
if len(v) == 10 {
|
||||||
v = fmt.Sprintf("%s000", v)
|
v = fmt.Sprintf("%s000", v)
|
||||||
@@ -90,8 +93,7 @@ func (r TraceTask) SelectByPage(query map[string]string) ([]model.TraceTask, int
|
|||||||
tx = tx.Order("id desc")
|
tx = tx.Order("id desc")
|
||||||
}
|
}
|
||||||
|
|
||||||
err := tx.Find(&rows).Error
|
if err := tx.Find(&rows).Error; err != nil {
|
||||||
if err != nil {
|
|
||||||
logger.Errorf("query find err => %v", err.Error())
|
logger.Errorf("query find err => %v", err.Error())
|
||||||
return rows, total
|
return rows, total
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user