|
@ -1,6 +1,7 @@
|
|
|
package com.yihu.wlyy.service.app.statistics;
|
|
|
|
|
|
import com.yihu.wlyy.entity.address.Town;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.organization.Hospital;
|
|
|
import com.yihu.wlyy.entity.statistics.PopulationBase;
|
|
@ -2933,19 +2934,17 @@ public class StatisticsService extends BaseService {
|
|
|
" GROUP BY dateNo";
|
|
|
|
|
|
planSQL ="SELECT " +
|
|
|
" ( " +
|
|
|
" DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('"+DateUtil.getFristDayOfMonth()+"', '%v') + 1 " +
|
|
|
" ) AS weekOfMonth,COUNT(1) AS planCount " +
|
|
|
"FROM " +
|
|
|
" left(w.create_time,10) AS dateNo,COUNT(1) AS planCount " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup w " +
|
|
|
"WHERE " +
|
|
|
" WHERE " +
|
|
|
" w.admin_team_code =" +teamCode+
|
|
|
" AND w.doctor_code ='"+doctor+"'"+
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.status ='2'"+
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY weekOfMonth";
|
|
|
" GROUP BY dateNo";
|
|
|
}else{
|
|
|
//按月
|
|
|
totalSQL ="SELECT " +
|
|
@ -2964,7 +2963,7 @@ public class StatisticsService extends BaseService {
|
|
|
planSQL = "SELECT " +
|
|
|
" ( " +
|
|
|
" DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('"+DateUtil.getFristDayOfMonth()+"', '%v') + 1 " +
|
|
|
" ) AS weekOfMonth,COUNT(1) AS followupCount " +
|
|
|
" ) AS weekOfMonth,COUNT(1) AS planCount " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup w " +
|
|
|
" WHERE " +
|
|
@ -2998,7 +2997,7 @@ public class StatisticsService extends BaseService {
|
|
|
" WHERE " +
|
|
|
" w.admin_team_code =" +teamCode+
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY dateNo";
|
|
|
|
|
@ -3210,7 +3209,7 @@ public class StatisticsService extends BaseService {
|
|
|
//按增量排序
|
|
|
if(addList!=null&&addList.size()>0){
|
|
|
//以增量为基准,合并结果集
|
|
|
for(Map<String ,Object> map : totalList){
|
|
|
for(Map<String ,Object> map : addList){
|
|
|
|
|
|
String code = (String)map.get("doctorCode");
|
|
|
|
|
@ -3222,7 +3221,7 @@ public class StatisticsService extends BaseService {
|
|
|
map.put("planCount",0L);
|
|
|
}
|
|
|
|
|
|
Map<String,Object> m2 =(Map<String,Object>)planMap.get(code);
|
|
|
Map<String,Object> m2 =(Map<String,Object>)totalMap.get(code);
|
|
|
if(m2!=null){
|
|
|
Long followupCount = (Long)m2.get("followupCount");
|
|
|
map.put("followupCount",followupCount);
|
|
@ -3240,7 +3239,7 @@ public class StatisticsService extends BaseService {
|
|
|
String code = (String)map.get("doctorCode");
|
|
|
|
|
|
|
|
|
Map<String,Object> m =(Map<String,Object>)planMap.get(code);
|
|
|
Map<String,Object> m =(Map<String,Object>)totalMap.get(code);
|
|
|
if(m!=null){
|
|
|
Long followupCount = (Long)m.get("followupCount");
|
|
|
map.put("followupCount",followupCount);
|
|
@ -3998,4 +3997,14 @@ public class StatisticsService extends BaseService {
|
|
|
rs.put("addList",addList);
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getDoctorInfo(String code){
|
|
|
Doctor doctor = doctorDao.findByCode(code);
|
|
|
JSONObject rs = new JSONObject();
|
|
|
rs.put("doctorName",doctor.getName());
|
|
|
rs.put("doctor",doctor.getCode());
|
|
|
rs.put("photo",doctor.getPhoto());
|
|
|
return rs;
|
|
|
}
|
|
|
}
|