|
@ -264,28 +264,19 @@ public class NetworkStackConfigRepository : BaseRepository<NetworkStackConfig>, |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 根据ID获取网络栈配置(包含绑定关系和关联配置名称)
|
|
|
/// 根据ID获取网络栈配置(包含绑定关系和关联配置名称)
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public async Task<IList<NetworkStackConfigWithBindingNamesDto>> GetNetworkStackConfigByIdWithBindingNamesAsync(string id, CancellationToken cancellationToken = default) |
|
|
public async Task<IList<NetworkStackConfigBasicDto>> GetNetworkStackConfigByIdWithBindingNamesAsync(string id, CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
// 使用原生SQL查询来一次性获取所有需要的数据 - PostgreSQL语法
|
|
|
// 使用原生SQL查询来一次性获取所有需要的数据 - PostgreSQL语法
|
|
|
var sql = @"
|
|
|
var sql = @"
|
|
|
SELECT |
|
|
SELECT |
|
|
nsc.""Id"" AS ""NetworkStackConfigId"", |
|
|
|
|
|
nsc.""NetworkStackName"", |
|
|
nsc.""NetworkStackName"", |
|
|
nsc.""NetworkStackCode"", |
|
|
nsc.""NetworkStackCode"", |
|
|
nsc.""RanId"", |
|
|
nsc.""RanId"", |
|
|
ran.""Name"" AS ""RanName"", |
|
|
cnc.""Id"" AS ""CoreNetworkConfigId"", |
|
|
nsc.""Description"", |
|
|
ims.""Id"" AS ""IMSConfigId"", |
|
|
nsc.""IsActive"", |
|
|
ran.""ConfigContent"" AS ""RanConfigContent"", |
|
|
nsc.""CreatedAt"", |
|
|
cnc.""ConfigContent"" AS ""CoreNetworkConfigContent"", |
|
|
nsc.""UpdatedAt"", |
|
|
ims.""ConfigContent"" AS ""IMSConfigContent"" |
|
|
nsc.""CreatedBy"", |
|
|
|
|
|
nsc.""UpdatedBy"", |
|
|
|
|
|
binding.""Id"" AS ""StackCoreIMSBindingId"", |
|
|
|
|
|
binding.""Index"", |
|
|
|
|
|
binding.""CnId"" AS ""CoreNetworkConfigId"", |
|
|
|
|
|
cnc.""Name"" AS ""CoreNetworkConfigName"", |
|
|
|
|
|
binding.""ImsId"" AS ""IMSConfigId"", |
|
|
|
|
|
ims.""Name"" AS ""IMSConfigName"" |
|
|
|
|
|
FROM ""NetworkStackConfigs"" nsc |
|
|
FROM ""NetworkStackConfigs"" nsc |
|
|
LEFT JOIN ""RAN_Configurations"" ran ON nsc.""RanId"" = ran.""Id"" |
|
|
LEFT JOIN ""RAN_Configurations"" ran ON nsc.""RanId"" = ran.""Id"" |
|
|
LEFT JOIN ""Stack_CoreIMS_Bindings"" binding ON nsc.""Id"" = binding.""NetworkStackConfigId"" |
|
|
LEFT JOIN ""Stack_CoreIMS_Bindings"" binding ON nsc.""Id"" = binding.""NetworkStackConfigId"" |
|
@ -297,7 +288,7 @@ public class NetworkStackConfigRepository : BaseRepository<NetworkStackConfig>, |
|
|
var parameters = new object[] { id }; |
|
|
var parameters = new object[] { id }; |
|
|
|
|
|
|
|
|
// 执行查询
|
|
|
// 执行查询
|
|
|
var results = await ExecuteSqlQueryAsync<NetworkStackConfigWithBindingNamesDto>(sql, parameters, cancellationToken); |
|
|
var results = await ExecuteSqlQueryAsync<NetworkStackConfigBasicDto>(sql, parameters, cancellationToken); |
|
|
return results.ToList(); |
|
|
return results.ToList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -320,8 +311,6 @@ public class NetworkStackConfigRepository : BaseRepository<NetworkStackConfig>, |
|
|
nsc.""RanId"", |
|
|
nsc.""RanId"", |
|
|
ran.""Name"" AS ""RanName"", |
|
|
ran.""Name"" AS ""RanName"", |
|
|
ran.""ConfigContent"" AS ""RanConfigContent"", |
|
|
ran.""ConfigContent"" AS ""RanConfigContent"", |
|
|
ran.""ConfigContent"" AS ""RanConfigContent"", |
|
|
|
|
|
ran.""ConfigContent"" AS ""RanConfigContent"", |
|
|
|
|
|
nsc.""Description"", |
|
|
nsc.""Description"", |
|
|
nsc.""IsActive"", |
|
|
nsc.""IsActive"", |
|
|
nsc.""CreatedAt"", |
|
|
nsc.""CreatedAt"", |
|
@ -332,8 +321,10 @@ public class NetworkStackConfigRepository : BaseRepository<NetworkStackConfig>, |
|
|
binding.""Index"", |
|
|
binding.""Index"", |
|
|
binding.""CnId"" AS ""CoreNetworkConfigId"", |
|
|
binding.""CnId"" AS ""CoreNetworkConfigId"", |
|
|
cnc.""Name"" AS ""CoreNetworkConfigName"", |
|
|
cnc.""Name"" AS ""CoreNetworkConfigName"", |
|
|
|
|
|
cnc.""ConfigContent"" AS ""CoreNetworkConfigContent"", |
|
|
binding.""ImsId"" AS ""IMSConfigId"", |
|
|
binding.""ImsId"" AS ""IMSConfigId"", |
|
|
ims.""Name"" AS ""IMSConfigName"" |
|
|
ims.""Name"" AS ""IMSConfigName"", |
|
|
|
|
|
ims.""ConfigContent"" AS ""IMSConfigContent"" |
|
|
FROM ""NetworkStackConfigs"" nsc |
|
|
FROM ""NetworkStackConfigs"" nsc |
|
|
LEFT JOIN ""RAN_Configurations"" ran ON nsc.""RanId"" = ran.""Id"" |
|
|
LEFT JOIN ""RAN_Configurations"" ran ON nsc.""RanId"" = ran.""Id"" |
|
|
LEFT JOIN ""Stack_CoreIMS_Bindings"" binding ON nsc.""Id"" = binding.""NetworkStackConfigId"" |
|
|
LEFT JOIN ""Stack_CoreIMS_Bindings"" binding ON nsc.""Id"" = binding.""NetworkStackConfigId"" |
|
@ -407,6 +398,7 @@ public class NetworkStackConfigRepository : BaseRepository<NetworkStackConfig>, |
|
|
nsc.""NetworkStackCode"", |
|
|
nsc.""NetworkStackCode"", |
|
|
nsc.""RanId"", |
|
|
nsc.""RanId"", |
|
|
ran.""Name"" AS ""RanName"", |
|
|
ran.""Name"" AS ""RanName"", |
|
|
|
|
|
ran.""ConfigContent"" AS ""RanConfigContent"", |
|
|
nsc.""Description"", |
|
|
nsc.""Description"", |
|
|
nsc.""IsActive"", |
|
|
nsc.""IsActive"", |
|
|
nsc.""CreatedAt"", |
|
|
nsc.""CreatedAt"", |
|
@ -417,8 +409,10 @@ public class NetworkStackConfigRepository : BaseRepository<NetworkStackConfig>, |
|
|
binding.""Index"", |
|
|
binding.""Index"", |
|
|
binding.""CnId"" AS ""CoreNetworkConfigId"", |
|
|
binding.""CnId"" AS ""CoreNetworkConfigId"", |
|
|
cnc.""Name"" AS ""CoreNetworkConfigName"", |
|
|
cnc.""Name"" AS ""CoreNetworkConfigName"", |
|
|
|
|
|
cnc.""ConfigContent"" AS ""CoreNetworkConfigContent"", |
|
|
binding.""ImsId"" AS ""IMSConfigId"", |
|
|
binding.""ImsId"" AS ""IMSConfigId"", |
|
|
ims.""Name"" AS ""IMSConfigName"" |
|
|
ims.""Name"" AS ""IMSConfigName"", |
|
|
|
|
|
ims.""ConfigContent"" AS ""IMSConfigContent"" |
|
|
FROM ""NetworkStackConfigs"" nsc |
|
|
FROM ""NetworkStackConfigs"" nsc |
|
|
LEFT JOIN ""RAN_Configurations"" ran ON nsc.""RanId"" = ran.""Id"" |
|
|
LEFT JOIN ""RAN_Configurations"" ran ON nsc.""RanId"" = ran.""Id"" |
|
|
LEFT JOIN ""Stack_CoreIMS_Bindings"" binding ON nsc.""Id"" = binding.""NetworkStackConfigId"" |
|
|
LEFT JOIN ""Stack_CoreIMS_Bindings"" binding ON nsc.""Id"" = binding.""NetworkStackConfigId"" |
|
|