|
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http.Features;
|
|
|
using Microsoft.AspNetCore.ResponseCompression;
|
|
using Microsoft.AspNetCore.ResponseCompression;
|
|
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
|
+using Microsoft.IdentityModel.Tokens;
|
|
|
using OASystem.API.Middlewares;
|
|
using OASystem.API.Middlewares;
|
|
|
using OASystem.API.OAMethodLib;
|
|
using OASystem.API.OAMethodLib;
|
|
|
using OASystem.API.OAMethodLib.AMapApi;
|
|
using OASystem.API.OAMethodLib.AMapApi;
|
|
@@ -223,14 +224,19 @@ builder.Services.AddScoped(options =>
|
|
|
|
|
|
|
|
foreach (var param in pars)
|
|
foreach (var param in pars)
|
|
|
{
|
|
{
|
|
|
- var formattedValue = param.Value switch
|
|
|
|
|
|
|
+ var par = param.Value;
|
|
|
|
|
+ if (par != null)
|
|
|
{
|
|
{
|
|
|
- string str => $"'{str.Replace("'", "''")}'",
|
|
|
|
|
- DateTime date => $"'{date:yyyy-MM-dd HH:mm:ss}'",
|
|
|
|
|
- bool b => b ? "1" : "0",
|
|
|
|
|
- _ => param.Value.ToString()
|
|
|
|
|
- };
|
|
|
|
|
- resultSql = resultSql.Replace(param.ParameterName, formattedValue);
|
|
|
|
|
|
|
+ var formattedValue = par switch
|
|
|
|
|
+ {
|
|
|
|
|
+ string str => $"'{str.Replace("'", "''")}'",
|
|
|
|
|
+ DateTime date => $"'{date:yyyy-MM-dd HH:mm:ss}'",
|
|
|
|
|
+ bool b => b ? "1" : "0",
|
|
|
|
|
+ _ => par.ToString()
|
|
|
|
|
+ };
|
|
|
|
|
+ resultSql = resultSql.Replace(param.ParameterName, formattedValue);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
Console.WriteLine(resultSql);
|
|
Console.WriteLine(resultSql);
|
|
|
Console.WriteLine("=====================================");
|
|
Console.WriteLine("=====================================");
|