diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs index 3cecb1a37..adc0496db 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs @@ -146,6 +146,22 @@ namespace SqlSugar } this.AppendOpreator(parameter, isLeft); } + else if (value is MapperSql) + { + var sql = ((MapperSql)value).Sql; + if (isLeft == true) + { + sql += ExpressionConst.ExpressionReplace + parameter.BaseParameter.Index; + } + if (this.Context.Result.Contains(ExpressionConst.FormatSymbol)) + { + this.Context.Result.Replace(ExpressionConst.FormatSymbol, sql); + } + else + { + this.Context.Result.Append(sql); + } + } else if (oppoSiteExpression is MemberExpression) { string appendValue = Context.SqlParameterKeyWord @@ -202,22 +218,6 @@ namespace SqlSugar this.Context.Result.Append(appendValue); } } - else if (value is MapperSql) - { - var sql = ((MapperSql)value).Sql; - if (isLeft == true) - { - sql += ExpressionConst.ExpressionReplace + parameter.BaseParameter.Index; - } - if (this.Context.Result.Contains(ExpressionConst.FormatSymbol)) - { - this.Context.Result.Replace(ExpressionConst.FormatSymbol, sql); - } - else - { - this.Context.Result.Append(sql); - } - } else { var appendValue = this.Context.SqlParameterKeyWord + ExpressionConst.Const + Context.ParameterIndex;