@@ -80,7 +73,7 @@ public Comparison CheckEmployeeRealGiveFeeDiff(int allotId, string searchQuery)
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm OR if(@searchQuery='','',JobNumber) LIKE @parm OR if(@searchQuery='','',EmployeeName) LIKE @parm
GROUP BY HospitalId,Year,Month,AllotID,UnitType,AccountingUnit,JobNumber
ORDER BY HospitalId,Year,Month,ABS(SUM(RealGiveFeeExecl) - SUM(RealGiveFeeCompute)) DESC
ORDER BY HospitalId,Year,Month,ABS(SUM(RealGiveFeeExecl) - SUM(RealGiveFeeCompute)) DESC LIMIT @pageSize OFFSET @pageIndex
";
varqueryCount=@"
...
...
@@ -91,17 +84,17 @@ public Comparison CheckEmployeeRealGiveFeeDiff(int allotId, string searchQuery)
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm OR if(@searchQuery='','',JobNumber) LIKE @parm OR if(@searchQuery='','',EmployeeName) LIKE @parm
varwhere=request.Search.Where(w=>!string.IsNullOrEmpty(w.Title)&&!string.IsNullOrEmpty(w.Value)).Select(t=>$"{t.Title} like '%{t.Value}%'");
sql+=" and "+string.Join(" and ",where);
}
if(!string.IsNullOrEmpty(request.SortBy))
sql+=$" order by {request.SortBy} ";
sql=$"select {string.Join(",",request.GroupBy)}, {string.Join(",",request.SumBy.Select(t=>$"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",",request.GroupBy)}";