From b389dcbf3086f0f281d6fd7ff2ab66a0c0c139db Mon Sep 17 00:00:00 2001 From: yanghongwei Date: Mon, 21 Jul 2025 17:33:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/AlarmService.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Service/AlarmService.cs b/Service/AlarmService.cs index f8acef8..189f51e 100644 --- a/Service/AlarmService.cs +++ b/Service/AlarmService.cs @@ -388,24 +388,19 @@ namespace LY.App.Service ) AS CountTable;"; string page = @" SELECT * -FROM ( - SELECT batch_id - FROM ( - {0} - ) AS unionTable - GROUP BY batch_id ORDER BY batch_id desc LIMIT {1},{2} -) AS CountTable "; + FROM ( + SELECT batch_id + FROM ( + {0} + ) AS unionTable + GROUP BY batch_id ORDER BY batch_id desc LIMIT {1},{2} + ) AS CountTable "; string tablesql = string.Join(" UNION ALL ", tables.Select(item => $"SELECT batch_id FROM {item.TableName} ")); if (!string.IsNullOrEmpty(input.sn)) { tablesql = string.Join(" UNION ALL ", tables.Select(item => $"SELECT batch_id FROM {item.TableName} where serial_number like '%{input.sn}%' ")); } - - - //var total = _db.Ado.GetInt(string.Format(coutsql, tablesql)); - //var ids = _db.Ado.SqlQuery(string.Format(page, tablesql, (input.pageNum - 1) * input.pageSize, input.pageSize)); - var pageitem = await _db.Ado.SqlQueryAsync(string.Format(coutsql, tablesql) + string.Format(page, tablesql, (input.pageNum - 1) * input.pageSize, input.pageSize)); var query = await _db.Queryable()