fix: 网元信息新增更新同步操作版本和授权信息
This commit is contained in:
@@ -34,7 +34,7 @@ var neListSort = []string{
|
||||
|
||||
// 实例化数据层 NeInfoImpl 结构体
|
||||
var NewNeInfoImpl = &NeInfoImpl{
|
||||
selectSql: `select id, ne_type, ne_id, rm_uid, ne_name, ip, port, pv_flag, province, vendor_name, dn, ne_address, status, update_time, host_ids from ne_info`,
|
||||
selectSql: `select id, ne_type, ne_id, rm_uid, ne_name, ip, port, pv_flag, province, vendor_name, dn, ne_address, status, update_time, update_by, host_ids from ne_info`,
|
||||
|
||||
resultMap: map[string]string{
|
||||
"id": "ID",
|
||||
@@ -51,6 +51,7 @@ var NewNeInfoImpl = &NeInfoImpl{
|
||||
"ne_address": "NeAddress",
|
||||
"status": "Status",
|
||||
"update_time": "UpdateTime",
|
||||
"update_by": "UpdateBy",
|
||||
"host_ids": "HostIDs",
|
||||
},
|
||||
}
|
||||
@@ -298,8 +299,13 @@ func (r *NeInfoImpl) Insert(neInfo model.NeInfo) string {
|
||||
if neInfo.NeAddress != "" {
|
||||
params["ne_address"] = neInfo.NeAddress
|
||||
}
|
||||
params["status"] = neInfo.Status
|
||||
params["update_time"] = time.Now()
|
||||
if neInfo.Status != "" {
|
||||
params["status"] = neInfo.Status
|
||||
}
|
||||
if neInfo.UpdateBy != "" {
|
||||
params["update_by"] = neInfo.UpdateBy
|
||||
params["update_time"] = time.Now().UnixMilli()
|
||||
}
|
||||
if neInfo.HostIDs != "" {
|
||||
params["host_ids"] = neInfo.HostIDs
|
||||
}
|
||||
@@ -360,8 +366,13 @@ func (r *NeInfoImpl) Update(neInfo model.NeInfo) int64 {
|
||||
params["vendor_name"] = neInfo.VendorName
|
||||
params["dn"] = neInfo.Dn
|
||||
params["ne_address"] = neInfo.NeAddress
|
||||
params["status"] = neInfo.Status
|
||||
params["update_time"] = time.Now()
|
||||
if neInfo.Status != "" {
|
||||
params["status"] = neInfo.Status
|
||||
}
|
||||
if neInfo.UpdateBy != "" {
|
||||
params["update_by"] = neInfo.UpdateBy
|
||||
params["update_time"] = time.Now().UnixMilli()
|
||||
}
|
||||
if neInfo.HostIDs != "" {
|
||||
params["host_ids"] = neInfo.HostIDs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user