为 DataHandler 增加 KeepFirstPage 属性。

当该属性为 true 时,每次读取只抽取第一页的数据。
适用于时间字段在任务内部会被更新的情况。
This commit is contained in:
Soar360 2024-09-03 17:04:01 +08:00
parent 16c77f4b07
commit 548a82f766
1 changed files with 4 additions and 1 deletions

View File

@ -96,6 +96,9 @@ public abstract class DataHandler : Handler
/// <summary>选择列</summary>
public String Selects { get; set; }
/// <summary>每次都只查第一页</summary>
public bool KeepFirstPage { get; set; }
#endregion
#region
@ -231,7 +234,7 @@ public abstract class DataHandler : Handler
if (!Where.IsNullOrEmpty()) exp &= Where;
var list = Factory.FindAll(exp, OrderBy, Selects, row, task.BatchSize);
var list = Factory.FindAll(exp, OrderBy, Selects, this.KeepFirstPage ? 0 : row, task.BatchSize);
// 取到数据,需要滑动窗口
if (list.Count > 0) row += list.Count;