细节调整
This commit is contained in:
parent
97b9cc06dc
commit
f94bdcc506
|
|
@ -396,10 +396,10 @@ namespace LY.App.Service
|
||||||
GROUP BY batch_id ORDER BY batch_id desc LIMIT {1},{2}
|
GROUP BY batch_id ORDER BY batch_id desc LIMIT {1},{2}
|
||||||
) AS CountTable ";
|
) AS CountTable ";
|
||||||
|
|
||||||
string tablesql = string.Join(" UNION ALL ", tables.Select(item => $"SELECT batch_id FROM {item.TableName} Group By batch_id "));
|
string tablesql = string.Join(" UNION ALL ", tables.Select(item => $"SELECT batch_id FROM {item.TableName} GROUP BY batch_id "));
|
||||||
if (!string.IsNullOrEmpty(input.sn))
|
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}%' Group By batch_id"));
|
tablesql = string.Join(" UNION ALL ", tables.Select(item => $"SELECT batch_id FROM {item.TableName} where serial_number like '%{input.sn}%' GROUP BY batch_id"));
|
||||||
}
|
}
|
||||||
var pageitem = await _db.Ado.SqlQueryAsync<int, long>(string.Format(coutsql, tablesql) + string.Format(page, tablesql, (input.pageNum - 1) * input.pageSize, input.pageSize));
|
var pageitem = await _db.Ado.SqlQueryAsync<int, long>(string.Format(coutsql, tablesql) + string.Format(page, tablesql, (input.pageNum - 1) * input.pageSize, input.pageSize));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue