fix: 网元信息表结构体变更
This commit is contained in:
@@ -35,7 +35,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, update_by, 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, host_ids, status, remark, create_by, create_time, update_by, update_time from ne_info`,
|
||||
|
||||
resultMap: map[string]string{
|
||||
"id": "ID",
|
||||
@@ -50,10 +50,13 @@ var NewNeInfoImpl = &NeInfoImpl{
|
||||
"vendor_name": "VendorName",
|
||||
"dn": "Dn",
|
||||
"ne_address": "NeAddress",
|
||||
"status": "Status",
|
||||
"update_time": "UpdateTime",
|
||||
"update_by": "UpdateBy",
|
||||
"host_ids": "HostIDs",
|
||||
"status": "Status",
|
||||
"remark": "Remark",
|
||||
"create_by": "CreateBy",
|
||||
"create_time": "CreateTime",
|
||||
"update_by": "UpdateBy",
|
||||
"update_time": "UpdateTime",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -300,15 +303,18 @@ func (r *NeInfoImpl) Insert(neInfo model.NeInfo) string {
|
||||
if neInfo.NeAddress != "" {
|
||||
params["ne_address"] = neInfo.NeAddress
|
||||
}
|
||||
if neInfo.HostIDs != "" {
|
||||
params["host_ids"] = neInfo.HostIDs
|
||||
}
|
||||
if neInfo.Status != "" {
|
||||
params["status"] = neInfo.Status
|
||||
}
|
||||
if neInfo.UpdateBy != "" {
|
||||
params["update_by"] = neInfo.UpdateBy
|
||||
params["update_time"] = time.Now().UnixMilli()
|
||||
if neInfo.Remark != "" {
|
||||
params["remark"] = neInfo.Remark
|
||||
}
|
||||
if neInfo.HostIDs != "" {
|
||||
params["host_ids"] = neInfo.HostIDs
|
||||
if neInfo.CreateBy != "" {
|
||||
params["create_by"] = neInfo.CreateBy
|
||||
params["create_time"] = time.Now().UnixMilli()
|
||||
}
|
||||
|
||||
// 构建执行语句
|
||||
@@ -367,6 +373,10 @@ func (r *NeInfoImpl) Update(neInfo model.NeInfo) int64 {
|
||||
params["vendor_name"] = neInfo.VendorName
|
||||
params["dn"] = neInfo.Dn
|
||||
params["ne_address"] = neInfo.NeAddress
|
||||
if neInfo.HostIDs != "" {
|
||||
params["host_ids"] = neInfo.HostIDs
|
||||
}
|
||||
params["remark"] = neInfo.Remark
|
||||
if neInfo.Status != "" {
|
||||
params["status"] = neInfo.Status
|
||||
}
|
||||
@@ -374,9 +384,6 @@ func (r *NeInfoImpl) Update(neInfo model.NeInfo) int64 {
|
||||
params["update_by"] = neInfo.UpdateBy
|
||||
params["update_time"] = time.Now().UnixMilli()
|
||||
}
|
||||
if neInfo.HostIDs != "" {
|
||||
params["host_ids"] = neInfo.HostIDs
|
||||
}
|
||||
|
||||
// 构建执行语句
|
||||
keys, values := repo.KeyValueByUpdate(params)
|
||||
|
||||
Reference in New Issue
Block a user