mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Synchronization code
This commit is contained in:
parent
449ac52cde
commit
4796aaa8d3
@ -25,14 +25,14 @@ namespace SqlSugar
|
||||
case ResolveExpressType.SelectMultiple:
|
||||
if (parameter.BaseParameter!=null&¶meter.BaseParameter.CurrentExpression.NodeType == ExpressionType.Lambda)
|
||||
{
|
||||
if (this.Context.PgSqlIsAutoToLower == false&&this.Context is PostgreSQLExpressionContext)
|
||||
{
|
||||
//if (this.Context.PgSqlIsAutoToLower == false&&this.Context is PostgreSQLExpressionContext)
|
||||
//{
|
||||
this.Context.Result.Append(this.Context.GetTranslationColumnName(expression.Name) + ".*");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Context.Result.Append(expression.Name + ".*");
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// this.Context.Result.Append(expression.Name + ".*");
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ namespace SqlSugar
|
||||
{
|
||||
sqlParameter.DbType = System.Data.DbType.String;
|
||||
if(sqlParameter.Value != DBNull.Value)
|
||||
sqlParameter.Value = sqlParameter.Value.ToString();
|
||||
sqlParameter.Value = sqlParameter.Value.ToString();
|
||||
}
|
||||
if (parameter.Direction == 0)
|
||||
{
|
||||
@ -177,15 +177,15 @@ namespace SqlSugar
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string[] KeyWord =new string []{"@order", ":order", "@user", "@level", ":user", ":level",":type","@type"};
|
||||
private static string ReplaceKeyWordParameterName(string sql, SugarParameter[] parameters)
|
||||
{
|
||||
if (parameters.HasValue() && parameters.Count(it => it.ParameterName.ToLower().IsIn("@order", ":order", "@user", "@level", ":user", ":level"))>0)
|
||||
if (parameters.HasValue() && parameters.Count(it => it.ParameterName.ToLower().IsIn(KeyWord))>0)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (var Parameter in parameters.OrderByDescending(it=>it.ParameterName.Length))
|
||||
{
|
||||
if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsContainsIn("@order", ":order", "@user", "@level", ":user", ":level"))
|
||||
if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsContainsIn(KeyWord))
|
||||
{
|
||||
var newName = ":p" + i + 100;
|
||||
sql = sql.Replace(Parameter.ParameterName, newName);
|
||||
|
@ -121,14 +121,14 @@ namespace SqlSugar
|
||||
CheckConnection();
|
||||
return sqlCommand;
|
||||
}
|
||||
|
||||
private static string[] KeyWord = new string[] { "@order", ":order", "@user", "@level", ":user", ":level", ":type", "@type" };
|
||||
private static string ReplaceKeyWordParameterName(string sql, SugarParameter[] parameters)
|
||||
{
|
||||
if (parameters.HasValue())
|
||||
{
|
||||
foreach (var Parameter in parameters)
|
||||
{
|
||||
if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsIn("@order",":order","@user", "@level", ":user", ":level"))
|
||||
if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsIn(KeyWord))
|
||||
{
|
||||
if (parameters.Count(it => it.ParameterName.StartsWith(Parameter.ParameterName)) == 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user