fix: 移除网元状态过滤判断status in ('0','3')
This commit is contained in:
@@ -228,12 +228,12 @@ func XormGetNeInfo(neType string, neId string) (*NeInfo, error) {
|
||||
log.Debug("XormGetNeInfo processing... ")
|
||||
|
||||
neInfo := new(NeInfo)
|
||||
has, err := xEngine.Where("status in ('0','3') and ne_type=? and ne_id=?", strings.ToUpper(neType), neId).Get(neInfo)
|
||||
has, err := xEngine.Where("ne_type=? and ne_id=?", strings.ToUpper(neType), neId).Get(neInfo)
|
||||
if err != nil {
|
||||
log.Error("Failed to get table ne_info from database:", err)
|
||||
return nil, err
|
||||
} else if !has {
|
||||
log.Infof("Not found ne_info from database, status in ('0','3'), neType=%s, neId=%s", neType, neId)
|
||||
log.Infof("Not found ne_info from database, neType=%s, neId=%s", neType, neId)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -245,12 +245,12 @@ func XormGetNeInfoByRmUID(neType string, rmUID string) (*NeInfo, error) {
|
||||
log.Debug("XormGetNeInfoByRmUID processing... ")
|
||||
|
||||
neInfo := new(NeInfo)
|
||||
has, err := xEngine.Where("status in ('0','3') and ne_type=? and rm_uid=?", strings.ToUpper(neType), rmUID).Get(neInfo)
|
||||
has, err := xEngine.Where("ne_type=? and rm_uid=?", strings.ToUpper(neType), rmUID).Get(neInfo)
|
||||
if err != nil {
|
||||
log.Error("Failed to get table ne_info from database:", err)
|
||||
return nil, err
|
||||
} else if !has {
|
||||
log.Infof("Not found ne_info from database, status in ('0','3'), neType=%s, neId=%s", neType, rmUID)
|
||||
log.Infof("Not found ne_info from database, neType=%s, neId=%s", neType, rmUID)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ func XormGetNeInfoByNeType(neType string, nes *[]NeInfo) error {
|
||||
log.Debug("XormGetNeInfoByNeType processing... ")
|
||||
|
||||
ne := new(NeInfo)
|
||||
rows, err := xEngine.Table("ne_info").Where("status in ('0','3') and ne_type=?", neType).Rows(ne)
|
||||
rows, err := xEngine.Table("ne_info").Where("ne_type=?", neType).Rows(ne)
|
||||
if err != nil {
|
||||
log.Error("Failed to get table ne_info from database:", err)
|
||||
return err
|
||||
@@ -310,12 +310,12 @@ func XormGetNeInfo2(neType string, neIDs []string, nes *[]NeInfo) error {
|
||||
var err error
|
||||
if len(neIDs) == 0 {
|
||||
rows, err = xEngine.Table("ne_info").
|
||||
Where("status in ('0','3') and ne_type=?", neType).
|
||||
Where("ne_type=?", neType).
|
||||
Rows(ne)
|
||||
} else {
|
||||
rows, err = xEngine.Table("ne_info").
|
||||
In("ne_id", neIDs).
|
||||
And("status in ('0','3') and ne_type=?", neType).
|
||||
And("ne_type=?", neType).
|
||||
Rows(ne)
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user