mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update unit test
This commit is contained in:
parent
7863ba85f0
commit
f11b38f4e8
@ -13,8 +13,11 @@ namespace OrmTest
|
||||
var db = NewUnitTest.Db;
|
||||
db.CodeFirst.InitTables<OperatorInfo, Role, OptRole>();
|
||||
db.Queryable<OperatorInfo>()
|
||||
.Includes(x => x.Roles).Where(x => x.Roles.Any())
|
||||
.Includes(x => x.Roles).Where(x => x.Roles.Any(z=>z.id==1))
|
||||
.ToList();
|
||||
db.Queryable<OperatorInfo>()
|
||||
.Includes(x => x.Roles).Where(x => x.Roles.Any())
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -109,9 +109,12 @@ namespace SqlSugar
|
||||
mappingA = queryable.QueryBuilder.Builder.GetTranslationColumnName(mappingA);
|
||||
mappingB = queryable.QueryBuilder.Builder.GetTranslationColumnName(mappingB);
|
||||
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 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())
|
||||
mapper.Sql = mapper.Sql + " AND " + this.whereSql;
|
||||
{
|
||||
mapper.Sql = mapper.Sql.TrimEnd(')');
|
||||
mapper.Sql = mapper.Sql + " AND " + this.whereSql+")";
|
||||
}
|
||||
mapper.Sql = $" ({mapper.Sql}) ";
|
||||
mapper.Sql = GetMethodSql(mapper.Sql);
|
||||
return mapper;
|
||||
|
Loading…
Reference in New Issue
Block a user