Commit 0b903064 by 李承祥

排序

parent d5978a17
......@@ -44,7 +44,7 @@ public List<PerReport> AvgRatio(int hospitalid)
/// <returns></returns>
public List<PerReport> OutFeeAvg(List<string> date)
{
string sql = @"select concat(year,'-',lpad(month,2,'0')) y,deptname x,round(sum(fee) / sum(persontime),2) value from hos_personfee where source = '门诊' and concat(year,'-',lpad(month,2,'0')) in @date group by year,month,deptname order by y;";
string sql = @"select concat(year,'-',lpad(month,2,'0')) y,deptname x,round(sum(fee) / sum(persontime),2) value from hos_personfee where source = '门诊' and concat(year,'-',lpad(month,2,'0')) in @date group by year,month,deptname order by y asc,value desc;";
return DapperQuery(sql, new { date }).ToList();
}
......@@ -54,7 +54,7 @@ public List<PerReport> OutFeeAvg(List<string> date)
/// <returns></returns>
public List<PerReport> InpatFeeAvg(List<string> date)
{
string sql = @"select concat(year,'-',lpad(month,2,'0')) y,deptname x,round(sum(fee) / sum(persontime),2) value from hos_personfee where source = '住院' and concat(year,'-',lpad(month,2,'0')) in @date group by year,month,deptname order by y;";
string sql = @"select concat(year,'-',lpad(month,2,'0')) y,deptname x,round(sum(fee) / sum(persontime),2) value from hos_personfee where source = '住院' and concat(year,'-',lpad(month,2,'0')) in @date group by year,month,deptname order by y asc,value desc;";
return DapperQuery(sql, new { date }).ToList();
}
......@@ -68,7 +68,7 @@ public List<PerReport> Medicine(List<string> date)
('中成药费','西药费','中草药费'),cellvalue,0)) / sum(cellvalue))*100,2) value from per_allot aot
join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id where unittype=1 and sheettype=3
and sheetname like '%就诊收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0'))
in @date group by year,month,accountingunit order by y;";
in @date group by year,month,accountingunit order by y asc,value desc;";
return DapperQuery(sql, new { date }).ToList();
}
......@@ -82,7 +82,7 @@ public List<PerReport> Income(List<string> date)
('中成药费','西药费','中草药费','医材费'),cellvalue,0)) / sum(cellvalue))*100,2) value from per_allot aot
join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id where unittype=1 and sheettype=3
and sheetname like '%就诊收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0'))
in @date group by year,month,accountingunit order by y;";
in @date group by year,month,accountingunit order by y asc,value desc;";
return DapperQuery(sql, new { date }).ToList();
}
}
......
......@@ -119,7 +119,7 @@ public List<PerReport> DoctorAvg(int hospitalId, int isIndex)
X = t.AccountingUnit,
Value = Math.Round(t.Avg.Value, 2)
};
return s.OrderBy(t => t.Y).ToList();
return s.OrderBy(t => t.Y).ThenByDescending(t => t.Value).ToList();
}
/// <summary>
......@@ -151,7 +151,7 @@ public List<PerReport> NurseAvg(int hospitalId, int isIndex)
X = t.AccountingUnit,
Value = Math.Round(t.Avg.Value, 2)
};
return s.OrderBy(t => t.Y).ToList();
return s.OrderBy(t => t.Y).ThenByDescending(t => t.Value).ToList();
}
......
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