mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-05 05:07:57 +08:00
Optimize nested queries
This commit is contained in:
parent
846ae8f651
commit
757a938c93
@ -2396,10 +2396,13 @@ namespace SqlSugar
|
|||||||
|
|
||||||
private bool MasterHasWhereFirstJoin()
|
private bool MasterHasWhereFirstJoin()
|
||||||
{
|
{
|
||||||
if (this.QueryBuilder.IsSingle() == false && this.QueryBuilder.SelectValue is Expression&&this.QueryBuilder.AsTables?.Any()==false)
|
if (this.QueryBuilder.IsSingle() == false && this.QueryBuilder.SelectValue is LambdaExpression exp &&this.QueryBuilder.AsTables?.Any()==false)
|
||||||
|
{
|
||||||
|
if (exp.Parameters.Count == this.QueryBuilder.JoinQueryInfos.Count)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return this.QueryBuilder.JoinIndex == 0 &&
|
return this.QueryBuilder.JoinIndex == 0 &&
|
||||||
this.QueryBuilder.IsSqlQuery == false &&
|
this.QueryBuilder.IsSqlQuery == false &&
|
||||||
!this.QueryBuilder.AsTables.Any() &&
|
!this.QueryBuilder.AsTables.Any() &&
|
||||||
|
Loading…
Reference in New Issue
Block a user