|
@ -122,6 +122,8 @@ public class StatisticsEsService {
|
|
|
String sql = "select count(*) as total from base.wlyy_consult_oupatient_info o where o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
|
|
|
if (level==4){
|
|
|
sql += " and o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
|
|
|
}if (level==2){
|
|
|
sql += " 1=1 ";
|
|
|
}else if (level==5){
|
|
|
sql += " and o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.dept_code ='"+area+"' and dh.del=1)";
|
|
|
}else if (level==6){
|
|
@ -2659,11 +2661,24 @@ public class StatisticsEsService {
|
|
|
resultMaps.add(rs);
|
|
|
}
|
|
|
//根据为回复数排序
|
|
|
Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
|
|
|
/* Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
|
|
|
|
|
|
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
|
|
|
return (Double) o1.get("total") < (Double) o2.get("total") ? 1 : ((Double) o1.get("total") == (Double) o2.get("total") ? 0 : -1);
|
|
|
}
|
|
|
});*/
|
|
|
Collections.sort(resultMaps, new Comparator<Map<String,Object>>() {
|
|
|
@Override
|
|
|
public int compare(Map<String,Object> o1, Map<String,Object> o2) {
|
|
|
Double total1 = (Double) o1.get("total");
|
|
|
Double total2 = (Double) o2.get("total");
|
|
|
if (total1 - total2 > 0) {
|
|
|
return -1;
|
|
|
} else if (total1 - total2 < 0) {
|
|
|
return 1;
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
});
|
|
|
result1.put("resultList", resultMaps);
|
|
|
return result1;
|