mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
-
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -97,5 +97,38 @@ namespace SqlSugar
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void AppendParameter(ExpressionParameter parameter, bool? isLeft, object value)
|
||||
{
|
||||
if (parameter.BaseExpression is BinaryExpression)
|
||||
{
|
||||
var otherExpression = isLeft == true ? parameter.BaseParameter.RightExpression : parameter.BaseParameter.LeftExpression;
|
||||
if (otherExpression is MemberExpression)
|
||||
{
|
||||
string parameterName = Context.SqlParameterKeyWord
|
||||
+ ((MemberExpression)otherExpression).Member.Name
|
||||
+ Context.ParameterIndex;
|
||||
this.Context.Parameters.Add(new SugarParameter(parameterName, value));
|
||||
Context.ParameterIndex++;
|
||||
parameterName = string.Format(" {0} ", parameterName);
|
||||
if (isLeft == true)
|
||||
{
|
||||
parameterName += ExpressionConst.Format1 + parameter.BaseParameter.Index;
|
||||
}
|
||||
if (this.Context.Result.Contains(ExpressionConst.Format0))
|
||||
{
|
||||
this.Context.Result.Replace(ExpressionConst.Format0, parameterName);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Context.Result.Append(parameterName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,34 +20,7 @@ namespace SqlSugar
|
||||
parameter.BaseParameter.CommonTempData = value;
|
||||
break;
|
||||
case ResolveExpressType.WhereSingle:
|
||||
if (parameter.BaseExpression is BinaryExpression)
|
||||
{
|
||||
var otherExpression = isLeft == true ? parameter.BaseParameter.RightExpression : parameter.BaseParameter.LeftExpression;
|
||||
if (otherExpression is MemberExpression)
|
||||
{
|
||||
string parameterName = Context.SqlParameterKeyWord
|
||||
+ ((MemberExpression)otherExpression).Member.Name
|
||||
+ Context.ParameterIndex;
|
||||
base.Context.Parameters.Add(new SugarParameter(parameterName, value));
|
||||
Context.ParameterIndex++;
|
||||
parameterName = string.Format(" {0} ", parameterName);
|
||||
if (isLeft == true)
|
||||
{
|
||||
parameterName += ExpressionConst.Format1 + parameter.BaseParameter.Index;
|
||||
}
|
||||
if (base.Context.Result.Contains(ExpressionConst.Format0))
|
||||
{
|
||||
base.Context.Result.Replace(ExpressionConst.Format0, parameterName);
|
||||
}
|
||||
else {
|
||||
base.Context.Result.Append(parameterName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
AppendParameter(parameter, isLeft, value);
|
||||
break;
|
||||
case ResolveExpressType.WhereMultiple:
|
||||
if (parameter.BaseExpression is BinaryExpression)
|
||||
|
@@ -21,35 +21,7 @@ namespace SqlSugar
|
||||
parameter.BaseParameter.CommonTempData = value;
|
||||
break;
|
||||
case ResolveExpressType.WhereSingle:
|
||||
if (parameter.BaseExpression is BinaryExpression)
|
||||
{
|
||||
var otherExpression = isLeft == true ? parameter.BaseParameter.RightExpression : parameter.BaseParameter.LeftExpression;
|
||||
if (otherExpression is MemberExpression)
|
||||
{
|
||||
string parameterName = Context.SqlParameterKeyWord
|
||||
+ ((MemberExpression)otherExpression).Member.Name
|
||||
+ Context.ParameterIndex;
|
||||
base.Context.Parameters.Add(new SugarParameter(parameterName, value));
|
||||
Context.ParameterIndex++;
|
||||
parameterName = string.Format(" {0} ", parameterName);
|
||||
if (isLeft == true)
|
||||
{
|
||||
parameterName += ExpressionConst.Format1 + parameter.BaseParameter.Index;
|
||||
}
|
||||
if (base.Context.Result.Contains(ExpressionConst.Format0))
|
||||
{
|
||||
base.Context.Result.Replace(ExpressionConst.Format0, parameterName);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Context.Result.Append(parameterName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
AppendParameter(parameter, isLeft, value);
|
||||
break;
|
||||
case ResolveExpressType.WhereMultiple:
|
||||
case ResolveExpressType.FieldSingle:
|
||||
|
@@ -26,35 +26,7 @@ namespace SqlSugar
|
||||
switch (base.Context.ResolveType)
|
||||
{
|
||||
case ResolveExpressType.WhereSingle:
|
||||
if (parameter.BaseExpression is BinaryExpression)
|
||||
{
|
||||
var otherExpression = isLeft == true ? parameter.BaseParameter.RightExpression : parameter.BaseParameter.LeftExpression;
|
||||
if (otherExpression is MemberExpression)
|
||||
{
|
||||
string parameterName = Context.SqlParameterKeyWord
|
||||
+ ((MemberExpression)otherExpression).Member.Name
|
||||
+ Context.ParameterIndex;
|
||||
base.Context.Parameters.Add(new SugarParameter(parameterName, value));
|
||||
Context.ParameterIndex++;
|
||||
parameterName = string.Format(" {0} ", parameterName);
|
||||
if (isLeft == true)
|
||||
{
|
||||
parameterName += ExpressionConst.Format1 + parameter.BaseParameter.Index;
|
||||
}
|
||||
if (base.Context.Result.Contains(ExpressionConst.Format0))
|
||||
{
|
||||
base.Context.Result.Replace(ExpressionConst.Format0, parameterName);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Context.Result.Append(parameterName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
AppendParameter(parameter, isLeft, value);
|
||||
break;
|
||||
case ResolveExpressType.WhereMultiple:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user