mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 04:59:34 +08:00
Update .net core project
This commit is contained in:
parent
b1bf42cf3d
commit
bc06140aef
@ -21,7 +21,7 @@ namespace SqlSugar
|
||||
.Select(expression)
|
||||
.ToList();
|
||||
var includeQueryable = queryableProvider.Clone();
|
||||
includeQueryable.Select(GetGroupSelect(typeof(T), queryableProvider.Context));
|
||||
includeQueryable.Select(GetGroupSelect(typeof(T), queryableProvider.Context,queryableProvider.QueryBuilder));
|
||||
includeQueryable.QueryBuilder.NoCheckInclude=true;
|
||||
MegerList(result, includeQueryable.ToList(), sqlfuncQueryable.Context);
|
||||
}
|
||||
@ -53,7 +53,7 @@ namespace SqlSugar
|
||||
.Select(expression)
|
||||
.ToListAsync();
|
||||
var includeQueryable = queryableProvider.Clone();
|
||||
includeQueryable.Select(GetGroupSelect(typeof(T), queryableProvider.Context));
|
||||
includeQueryable.Select(GetGroupSelect(typeof(T), queryableProvider.Context, queryableProvider.QueryBuilder));
|
||||
includeQueryable.QueryBuilder.NoCheckInclude = true;
|
||||
MegerList(result,await includeQueryable.ToListAsync(), sqlfuncQueryable.Context);
|
||||
}
|
||||
@ -75,14 +75,21 @@ namespace SqlSugar
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string GetGroupSelect(Type type,SqlSugarProvider context)
|
||||
private static string GetGroupSelect(Type type,SqlSugarProvider context,QueryBuilder queryBuilder)
|
||||
{
|
||||
var entity = context.EntityMaintenance.GetEntityInfo(type);
|
||||
List<string> selector = new List<string>();
|
||||
foreach (var item in entity.Columns.Where(it=>it.IsIgnore==false))
|
||||
{
|
||||
if (queryBuilder.TableShortName.HasValue())
|
||||
{
|
||||
selector.Add($" min({queryBuilder.TableShortName}.{item.DbColumnName}) as {item.DbColumnName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
selector.Add($" min({item.DbColumnName}) as {item.DbColumnName}");
|
||||
}
|
||||
}
|
||||
return string.Join(",", selector);
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,10 @@ namespace SqlSugar
|
||||
if (this.whereSql.HasValue())
|
||||
{
|
||||
mapper.Sql = mapper.Sql.TrimEnd(')');
|
||||
if (this.whereSql.Contains($" {PropertyShortName}."))
|
||||
{
|
||||
this.whereSql = this.whereSql.Replace($" {PropertyShortName}.", $" {this.ProPertyEntity.DbTableName}_1.");
|
||||
}
|
||||
mapper.Sql = mapper.Sql + " AND " + this.whereSql+")";
|
||||
}
|
||||
if (MethodName == "Any")
|
||||
|
Loading…
Reference in New Issue
Block a user