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()