This commit is contained in:
skx
2021-01-29 01:21:27 +08:00
parent 5a9478ee0d
commit 0d95bfef6e

View File

@@ -125,31 +125,36 @@ namespace SqlSugar
this.Context.Utilities.PageEach(allDatas, 300, itemList => this.Context.Utilities.PageEach(allDatas, 300, itemList =>
{ {
List<IConditionalModel> conditList = new List<IConditionalModel>(); List<IConditionalModel> conditList = new List<IConditionalModel>();
var condition = new ConditionalCollections() SetConditList(itemList, whereColumns, conditList);
{ var addItem = this.Context.Queryable<T>().Where(conditList).ToList();
ConditionalList = new List<KeyValuePair<WhereType, SqlSugar.ConditionalModel>>() this.dbDataList.AddRange(addItem);
};
foreach (var dataItem in itemList)
{
foreach (var item in whereColumns)
{
conditList.Add(condition);
condition.ConditionalList.Add(new KeyValuePair<WhereType, ConditionalModel>(WhereType.And, new ConditionalModel()
{
FieldName = item.DbColumnName,
ConditionalType = ConditionalType.Equal,
FieldValue = item.PropertyInfo.GetValue(dataItem,null)+""
}));
}
var addItem = this.Context.Queryable<T>().Where(conditList).ToList();
this.dbDataList.AddRange(addItem);
}
}); });
} }
return this; return this;
} }
} }
private static void SetConditList(List<StorageableInfo<T>> itemList, List<EntityColumnInfo> whereColumns, List<IConditionalModel> conditList)
{
var condition = new ConditionalCollections()
{
ConditionalList = new List<KeyValuePair<WhereType, SqlSugar.ConditionalModel>>()
};
foreach (var dataItem in itemList)
{
foreach (var item in whereColumns)
{
conditList.Add(condition);
condition.ConditionalList.Add(new KeyValuePair<WhereType, ConditionalModel>(WhereType.And, new ConditionalModel()
{
FieldName = item.DbColumnName,
ConditionalType = ConditionalType.Equal,
FieldValue = item.PropertyInfo.GetValue(dataItem, null) + ""
}));
}
}
}
public virtual ExpressionResult GetExpressionValue(Expression expression, ResolveExpressType resolveType) public virtual ExpressionResult GetExpressionValue(Expression expression, ResolveExpressType resolveType)
{ {
ILambdaExpressions resolveExpress = InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig); ; ILambdaExpressions resolveExpress = InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig); ;