排序

parent b8248656
...@@ -47,7 +47,7 @@ public Comparison GetComparison(ComparisonPagingRequest request) ...@@ -47,7 +47,7 @@ public Comparison GetComparison(ComparisonPagingRequest request)
var sql = $@"SELECT COUNT(*) FROM {request.ViewName} WHERE AllotId = @AllotId and {search}"; var sql = $@"SELECT COUNT(*) FROM {request.ViewName} WHERE AllotId = @AllotId and {search}";
result.TotalCount = DapperQuery<int>(sql, new { request.AllotId })?.FirstOrDefault() ?? 0; result.TotalCount = DapperQuery<int>(sql, new { request.AllotId })?.FirstOrDefault() ?? 0;
sql = $@"SELECT * FROM {request.ViewName} WHERE AllotId = @AllotId and {search} LIMIT {(request.PageIndex - 1) * request.PageSize},{request.PageSize}; "; sql = $@"SELECT * FROM {request.ViewName} WHERE AllotId = @AllotId and {search} ORDER BY HospitalId,Year,Month,ABS(DIFF) DESC LIMIT {(request.PageIndex - 1) * request.PageSize},{request.PageSize}; ";
result.Datas = DapperQuery<view_check_emp>(sql, new { request.AllotId })?.ToList(); result.Datas = DapperQuery<view_check_emp>(sql, new { request.AllotId })?.ToList();
return result; return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment