feat: UE/CDR查询条件imsi支持模糊匹配
This commit is contained in:
@@ -26,9 +26,9 @@ rest:
|
||||
port: 33443
|
||||
schema: https
|
||||
clientAuthType: 0
|
||||
caFile: ./etc/certs/omc-ca.crt
|
||||
certFile: ./etc/certs/omc-server.crt
|
||||
keyFile: ./etc/certs/omc-server.key
|
||||
caFile: ./restagent/etc/certs/omc-ca.crt
|
||||
certFile: ./restagent/etc/certs/omc-server.crt
|
||||
keyFile: ./restagent/etc/certs/omc-server.key
|
||||
|
||||
webServer:
|
||||
enabled: false
|
||||
|
||||
@@ -86,11 +86,11 @@ func (r *CDREventIMS) SelectPage(querys model.CDREventIMSQuery) map[string]any {
|
||||
params = append(params, endTime)
|
||||
}
|
||||
if querys.CallerParty != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.callerParty') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.callerParty') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.CallerParty)
|
||||
}
|
||||
if querys.CalledParty != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.calledParty') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.calledParty') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.CalledParty)
|
||||
}
|
||||
// MySQL8支持的
|
||||
|
||||
@@ -39,10 +39,10 @@ func (r CDREventSGWC) SelectByPage(querys model.CDREventSGWCQuery) ([]model.CDRE
|
||||
tx = tx.Where("timestamp <= ?", endTime)
|
||||
}
|
||||
if querys.IMSI != "" {
|
||||
tx = tx.Where("JSON_EXTRACT(cdr_json, '$.servedIMSI') = ?", querys.IMSI)
|
||||
tx = tx.Where("JSON_EXTRACT(cdr_json, '$.servedIMSI') like concat(concat('%', ?), '%')", querys.IMSI)
|
||||
}
|
||||
if querys.MSISDN != "" {
|
||||
tx = tx.Where("JSON_EXTRACT(cdr_json, '$.servedMSISDN') = ?", querys.MSISDN)
|
||||
tx = tx.Where("JSON_EXTRACT(cdr_json, '$.servedMSISDN') like concat(concat('%', ?), '%')", querys.MSISDN)
|
||||
}
|
||||
|
||||
// 查询结果
|
||||
|
||||
@@ -91,7 +91,7 @@ func (r *CDREventSMF) SelectPage(querys model.CDREventSMFQuery) map[string]any {
|
||||
params = append(params, querys.RecordType)
|
||||
}
|
||||
if querys.SubscriberID != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.subscriberIdentifier.subscriptionIDData') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.subscriberIdentifier.subscriptionIDData') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.SubscriberID)
|
||||
}
|
||||
if querys.DNN != "" {
|
||||
|
||||
@@ -86,11 +86,11 @@ func (r *CDREventSMSC) SelectPage(querys model.CDREventSMSCQuery) map[string]any
|
||||
params = append(params, endTime)
|
||||
}
|
||||
if querys.CallerParty != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.callerParty') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.callerParty') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.CallerParty)
|
||||
}
|
||||
if querys.CalledParty != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.calledParty') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(cdr_json, '$.calledParty') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.CalledParty)
|
||||
}
|
||||
// MySQL8支持的
|
||||
|
||||
@@ -95,7 +95,7 @@ func (r *UEEventAMF) SelectPage(querys model.UEEventAMFQuery) map[string]any {
|
||||
}
|
||||
}
|
||||
if querys.IMSI != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(event_json, '$.imsi') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(event_json, '$.imsi') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.IMSI)
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ func (r *UEEventMME) SelectPage(querys model.UEEventMMEQuery) map[string]any {
|
||||
}
|
||||
}
|
||||
if querys.IMSI != "" {
|
||||
conditions = append(conditions, "JSON_EXTRACT(event_json, '$.imsi') = ?")
|
||||
conditions = append(conditions, "JSON_EXTRACT(event_json, '$.imsi') like concat(concat('%', ?), '%')")
|
||||
params = append(params, querys.IMSI)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user