@@ -44,7 +44,7 @@ public List<PerReport> AvgRatio(int hospitalid)
...
@@ -44,7 +44,7 @@ public List<PerReport> AvgRatio(int hospitalid)
/// <returns></returns>
/// <returns></returns>
publicList<PerReport>OutFeeAvg(List<string>date)
publicList<PerReport>OutFeeAvg(List<string>date)
{
{
stringsql=@"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;";
stringsql=@"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;";
returnDapperQuery(sql,new{date}).ToList();
returnDapperQuery(sql,new{date}).ToList();
}
}
...
@@ -54,7 +54,7 @@ public List<PerReport> OutFeeAvg(List<string> date)
...
@@ -54,7 +54,7 @@ public List<PerReport> OutFeeAvg(List<string> date)
stringsql=@"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;";
stringsql=@"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;";
returnDapperQuery(sql,new{date}).ToList();
returnDapperQuery(sql,new{date}).ToList();
}
}
...
@@ -68,7 +68,7 @@ public List<PerReport> Medicine(List<string> date)
...
@@ -68,7 +68,7 @@ public List<PerReport> Medicine(List<string> date)
('中成药费','西药费','中草药费'),cellvalue,0)) / sum(cellvalue))*100,2) value from per_allot aot
('中成药费','西药费','中草药费'),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
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'))
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;";
returnDapperQuery(sql,new{date}).ToList();
returnDapperQuery(sql,new{date}).ToList();
}
}
...
@@ -82,7 +82,7 @@ public List<PerReport> Income(List<string> date)
...
@@ -82,7 +82,7 @@ public List<PerReport> Income(List<string> date)
('中成药费','西药费','中草药费','医材费'),cellvalue,0)) / sum(cellvalue))*100,2) value from per_allot aot
('中成药费','西药费','中草药费','医材费'),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
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'))
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;";