From d4a4f552b6c1e27e872ba4dba11ba4a7afcf40e6 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 31 Jan 2023 18:50:28 +0800 Subject: [PATCH] Update exp to sql --- .../ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs index f56201744..9d5ae9ba0 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs @@ -124,6 +124,11 @@ namespace SqlSugar base.ExactExpression = expression; var leftExpression = expression.Left; var rightExpression = expression.Right; + if (rightExpression is BinaryExpression && leftExpression is BinaryExpression&& expression.NodeType.IsIn(ExpressionType.AndAlso, ExpressionType.OrElse)) + { + base.Context.Result.Append($" {GetNewExpressionValue(leftExpression)} {(expression.NodeType==ExpressionType.AndAlso? " AND ":" OR ")} {GetNewExpressionValue(rightExpression)} "); + return; + } if (RightIsHasValue(leftExpression, rightExpression,ExpressionTool.IsLogicOperator(expression))) { Expression trueValue = Expression.Constant(true);