feat: license信息添加用户数/基站数字段记录

This commit is contained in:
TsMask
2025-08-29 16:23:03 +08:00
parent a7abd4e142
commit 066b9d41c9
7 changed files with 73 additions and 20 deletions

View File

@@ -14,7 +14,7 @@ import (
// 实例化数据层 NeLicense 结构体
var NewNeLicense = &NeLicense{
selectSql: `select
id, ne_type, ne_id, activation_request_code, license_path, serial_num, expiry_date, status, remark, create_by, create_time, update_by, update_time
id, ne_type, ne_id, activation_request_code, license_path, serial_num, expiry_date, ue_number, nb_number, status, remark, create_by, create_time, update_by, update_time
from ne_license`,
resultMap: map[string]string{
@@ -25,6 +25,8 @@ var NewNeLicense = &NeLicense{
"license_path": "LicensePath",
"serial_num": "SerialNum",
"expiry_date": "ExpiryDate",
"ue_number": "UeNumber",
"nb_number": "NbNumber",
"status": "Status",
"remark": "Remark",
"create_by": "CreateBy",
@@ -202,6 +204,12 @@ func (r *NeLicense) Insert(neLicense model.NeLicense) string {
if neLicense.ExpiryDate != "" {
params["expiry_date"] = neLicense.ExpiryDate
}
if neLicense.UeNumber > 0 {
params["ue_number"] = neLicense.UeNumber
}
if neLicense.NbNumber > 0 {
params["nb_number"] = neLicense.NbNumber
}
if neLicense.Status != "" {
params["status"] = neLicense.Status
}
@@ -262,6 +270,12 @@ func (r *NeLicense) Update(neLicense model.NeLicense) int64 {
if neLicense.ExpiryDate != "" {
params["expiry_date"] = neLicense.ExpiryDate
}
if neLicense.UeNumber > 0 {
params["ue_number"] = neLicense.UeNumber
}
if neLicense.NbNumber > 0 {
params["nb_number"] = neLicense.NbNumber
}
if neLicense.Status != "" {
params["status"] = neLicense.Status
}