任务限制优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Identity.Client.NativeInterop;
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,6 +12,7 @@ using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using WPFWCSDemo.Data;
|
||||
using WPFWCSDemo.Models.Tables;
|
||||
using WPFWCSDemo.StateCode;
|
||||
using WPFWCSDemo.Utilities;
|
||||
@@ -129,12 +131,15 @@ namespace WPFWCSDemo.ViewModels
|
||||
|
||||
TaskHistory.Clear();
|
||||
|
||||
//DataTable? dtCount = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY ORDER BY CREATETIME DESC");
|
||||
DataTable? dtCount = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC");
|
||||
//using var context = new AppDbContext();
|
||||
|
||||
DataTable? dtCount = SqlHelper.ExecuteTable("SELECT TOP 30000 * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC");
|
||||
|
||||
|
||||
//DataTable? dt = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY ORDER BY CREATETIME DESC OFFSET @Rows ROW FETCH NEXT 10 ROW ONLY",
|
||||
DataTable? dt = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC OFFSET @Rows ROW FETCH NEXT 10 ROW ONLY",
|
||||
new SqlParameter("@Rows",page - 1));
|
||||
|
||||
|
||||
|
||||
var datas = dt.Rows;
|
||||
|
||||
@@ -285,7 +290,7 @@ namespace WPFWCSDemo.ViewModels
|
||||
{
|
||||
dtCount = SqlHelper.ExecuteTable(
|
||||
//$"SELECT * FROM TASK_HISTORY WHERE @ColumnName like @Keywords AND FINISHTIME>=@StartTime AND FINISHTIME<@FinishTime ORDER BY CREATETIME DESC",
|
||||
$"SELECT * FROM TASK_HISTORY_VIEW WHERE {ColumnName} LIKE @Keywords AND 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
||||
$"SELECT TOP 30000 * FROM TASK_HISTORY_VIEW WHERE {ColumnName} LIKE @Keywords AND 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
||||
//new SqlParameter("@ColumnName", ColumnName),
|
||||
new SqlParameter("@Keywords", $"%{Keywords.Trim()}%"),
|
||||
new SqlParameter("@StartTime", dateTimeStart),
|
||||
@@ -306,7 +311,7 @@ namespace WPFWCSDemo.ViewModels
|
||||
{
|
||||
dtCount = SqlHelper.ExecuteTable(
|
||||
//$"SELECT * FROM TASK_HISTORY WHERE FINISHTIME>=@StartTime AND FINISHTIME<@FinishTime ORDER BY CREATETIME DESC",
|
||||
$"SELECT * FROM TASK_HISTORY_VIEW WHERE 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
||||
$"SELECT TOP 30000 * FROM TASK_HISTORY_VIEW WHERE 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
||||
new SqlParameter("@StartTime", dateTimeStart),
|
||||
new SqlParameter("@FinishTime", dateTimeEnd)
|
||||
);
|
||||
@@ -505,10 +510,10 @@ namespace WPFWCSDemo.ViewModels
|
||||
void UpdatePageInfo(DataTable dt, int pageCurrent)
|
||||
{
|
||||
//总数据条数
|
||||
DataCountNumber = dt.Rows.Count;
|
||||
DataCountNumber = 30000;
|
||||
|
||||
//文本显示
|
||||
DataCount = $"共 {DataCountNumber} 条";
|
||||
DataCount = $"只显示最近5万条数据";
|
||||
|
||||
//总页数
|
||||
if (DataCountNumber % countPerPage == 0)
|
||||
@@ -527,10 +532,10 @@ namespace WPFWCSDemo.ViewModels
|
||||
void UpdatePageInfo(DataTable dt, string pageCurrent)
|
||||
{
|
||||
//总数据条数
|
||||
DataCountNumber = dt.Rows.Count;
|
||||
DataCountNumber = 30000;
|
||||
|
||||
//文本显示
|
||||
DataCount = $"共 {DataCountNumber} 条";
|
||||
DataCount = $"只显示最近5万条数据";
|
||||
|
||||
//总页数
|
||||
if (DataCountNumber % countPerPage == 0)
|
||||
|
||||
Reference in New Issue
Block a user