Update 人大金仓[SqlServer]

This commit is contained in:
sunkaixuan 2024-08-13 10:16:49 +08:00
parent 842f9c4c88
commit 8e171fec97
2 changed files with 15 additions and 0 deletions

View File

@ -99,6 +99,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("name",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("text",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("char",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("nchar",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("character",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("cidr",CSharpDataType.@string),
new KeyValuePair<string, CSharpDataType>("circle",CSharpDataType.@string),

View File

@ -300,6 +300,10 @@ namespace SqlSugar
}
public override string DateAddByType(MethodCallExpressionModel model)
{
if (IsSqlServerModel(model))
{
return base.DateAddByType(model);
}
var parameter = model.Args[0];
var parameter2 = model.Args[1];
var parameter3 = model.Args[2];
@ -312,6 +316,10 @@ namespace SqlSugar
public override string DateAddDay(MethodCallExpressionModel model)
{
if (IsSqlServerModel(model))
{
return base.DateAddDay(model);
}
var parameter = model.Args[0];
var parameter2 = model.Args[1];
return string.Format(" ({0} + ({1}||'day')::INTERVAL) ", parameter.MemberName, parameter2.MemberName);
@ -494,5 +502,11 @@ namespace SqlSugar
}
return $" to_char({dateValue},'{formatString}') ";
}
private static bool IsSqlServerModel(MethodCallExpressionModel model)
{
return model?.Conext?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
}
}
}