mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 19:56:43 +08:00
Update Core
This commit is contained in:
parent
60dacbbccf
commit
a933c2f4ee
@ -123,13 +123,20 @@ namespace SqlSugar
|
|||||||
mappingA = queryable.QueryBuilder.Builder.GetTranslationColumnName(mappingA);
|
mappingA = queryable.QueryBuilder.Builder.GetTranslationColumnName(mappingA);
|
||||||
mappingB = queryable.QueryBuilder.Builder.GetTranslationColumnName(mappingB);
|
mappingB = queryable.QueryBuilder.Builder.GetTranslationColumnName(mappingB);
|
||||||
var bTableName = queryable.QueryBuilder.Builder.GetTranslationTableName(this.ProPertyEntity.DbTableName);
|
var bTableName = queryable.QueryBuilder.Builder.GetTranslationTableName(this.ProPertyEntity.DbTableName);
|
||||||
mapper.Sql = $" (select count(1) from {bTableName} {this.ProPertyEntity.DbTableName}_1 where {this.ProPertyEntity.DbTableName}_1.{bPk} in (select {mappingB} from {mappingTableName} where {mappingA} = {ShorName}.{aPk} ) )";
|
mapper.Sql = $" (select {(MethodName == "Any" ? "1":" COUNT(1) ")} from {bTableName} {this.ProPertyEntity.DbTableName}_1 where {this.ProPertyEntity.DbTableName}_1.{bPk} in (select {mappingB} from {mappingTableName} where {mappingA} = {ShorName}.{aPk} ) )";
|
||||||
if (this.whereSql.HasValue())
|
if (this.whereSql.HasValue())
|
||||||
{
|
{
|
||||||
mapper.Sql = mapper.Sql.TrimEnd(')');
|
mapper.Sql = mapper.Sql.TrimEnd(')');
|
||||||
mapper.Sql = mapper.Sql + " AND " + this.whereSql+")";
|
mapper.Sql = mapper.Sql + " AND " + this.whereSql+")";
|
||||||
}
|
}
|
||||||
mapper.Sql = $" ({mapper.Sql}) ";
|
if (MethodName == "Any")
|
||||||
|
{
|
||||||
|
mapper.Sql = $" {mapper.Sql} ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mapper.Sql = $" ({mapper.Sql}) ";
|
||||||
|
}
|
||||||
mapper.Sql = GetMethodSql(mapper.Sql);
|
mapper.Sql = GetMethodSql(mapper.Sql);
|
||||||
return mapper;
|
return mapper;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user