|
@ -2106,8 +2106,6 @@ public class StatisticsService extends BaseService {
|
|
|
*/
|
|
|
public Map<String,Object> getConsultByteam(Long id ,String startDate ,String endDate){
|
|
|
|
|
|
startDate = startDate+" 00:00:00";
|
|
|
endDate = endDate+" 23:59:59";
|
|
|
//咨询量
|
|
|
String consult_sql = "SELECT COUNT(1) AS consultCount FROM wlyy_consult_team t WHERE t.admin_team_code = "+id+" AND t.czrq <='"+endDate+"' AND t.czrq >='"+startDate+"'";
|
|
|
//获取咨詢數
|
|
@ -2119,8 +2117,6 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> getReservationByteam(Long id ,String startDate ,String endDate){
|
|
|
startDate = startDate+" 00:00:00";
|
|
|
endDate = endDate+" 23:59:59";
|
|
|
//获取待预约
|
|
|
String reservation_sql = "SELECT COUNT(1) AS reservationCount FROM wlyy_patient_reservation w WHERE w.admin_team_code ="+id+" AND w.czrq <='"+endDate+"' AND w.czrq >='"+startDate+"'";
|
|
|
//获取待预约
|
|
@ -2132,8 +2128,6 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> getEduArticleByTeam(Long id ,String startDate ,String endDate){
|
|
|
startDate = startDate+" 00:00:00";
|
|
|
endDate = endDate+" 23:59:59";
|
|
|
//获取健康教育
|
|
|
String article_sql = "SELECT COUNT(1) AS articleCount FROM wlyy_health_edu_article_patient w WHERE w.admin_team_code ="+id+" AND w.czrq <='"+endDate+"' AND w.czrq >='"+startDate+"'";
|
|
|
//获取健康教育
|
|
@ -2145,8 +2139,6 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> getGuidanceByTeam(Long id ,String startDate ,String endDate){
|
|
|
startDate = startDate+" 00:00:00";
|
|
|
endDate = endDate+" 23:59:59";
|
|
|
//获取健康指导
|
|
|
String guidance_sql = "SELECT COUNT(1) AS guidanceCount FROM wlyy_patient_health_guidance w WHERE w.admin_team_code ="+id+" AND w.czrq <='"+endDate+"' AND w.czrq >='"+startDate+"'";
|
|
|
//获取健康指导
|
|
@ -2158,10 +2150,8 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> getArticleByTeam(Long id ,String startDate ,String endDate){
|
|
|
startDate = startDate+" 00:00:00";
|
|
|
endDate = endDate+" 23:59:59";
|
|
|
//随访数目
|
|
|
String followup_sql ="SELECT COUNT(1) AS followupCount from wlyy_followup w WHERE w.admin_team_code="+id+" AND w.create_time >='"+startDate+"' AND w.create_time<='"+endDate+"' AND w.followup_class IS NOT NULL ";
|
|
|
String followup_sql ="SELECT COUNT(1) AS followupCount from wlyy_followup w WHERE w.admin_team_code="+id+" AND w.create_time >='"+startDate+"' AND w.create_time<='"+endDate+"' ";
|
|
|
//随访数目
|
|
|
Map<String,Object> followupCout= jdbcTemplate.queryForMap(followup_sql);
|
|
|
if(followupCout.get("followupCount")==null){
|
|
@ -2997,8 +2987,8 @@ public class StatisticsService extends BaseService {
|
|
|
" WHERE " +
|
|
|
" w.admin_team_code =" +teamCode+
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY dateNo";
|
|
|
|
|
|
planSQL ="SELECT " +
|
|
@ -3012,7 +3002,7 @@ public class StatisticsService extends BaseService {
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.status ='2'"+
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY weekOfMonth";
|
|
|
}else{
|
|
|
//按月
|
|
@ -3026,7 +3016,7 @@ public class StatisticsService extends BaseService {
|
|
|
" w.admin_team_code =" +teamCode+
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY weekOfMonth";
|
|
|
planSQL = "SELECT " +
|
|
|
" ( " +
|
|
@ -3039,7 +3029,7 @@ public class StatisticsService extends BaseService {
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.status ='2'"+
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY weekOfMonth";
|
|
|
}
|
|
|
List<Map<String,Object>> totalList = jdbcTemplate.queryForList(totalSQL);
|
|
@ -3069,7 +3059,7 @@ public class StatisticsService extends BaseService {
|
|
|
" WHERE " +
|
|
|
" w.admin_team_code =" +teamCode+
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY " +
|
|
|
" w.doctor_code " +
|
|
|
" ) c ON c.doctor_code =m.doctor_code, " +
|
|
@ -3101,7 +3091,7 @@ public class StatisticsService extends BaseService {
|
|
|
" w.admin_team_code =" +teamCode+
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY " +
|
|
|
" w.doctor_code " +
|
|
|
" ) c ON c.doctor_code =m.doctor_code, " +
|
|
@ -3134,7 +3124,7 @@ public class StatisticsService extends BaseService {
|
|
|
" AND w.create_time >= '"+startDate+"' " +
|
|
|
" AND w.create_time <= '"+endDate+"' " +
|
|
|
" AND w.status ='2'"+
|
|
|
" AND w.followup_class IS NOT NULL " +
|
|
|
// " AND w.followup_class IS NOT NULL " +
|
|
|
" GROUP BY " +
|
|
|
" w.doctor_code " +
|
|
|
" ) c ON c.doctor_code =m.doctor_code, " +
|
|
@ -4007,4 +3997,50 @@ public class StatisticsService extends BaseService {
|
|
|
rs.put("photo",doctor.getPhoto());
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getTeamRenewChangeLine(String teamCode,String startDate,String endDate,String type){
|
|
|
startDate = startDate+" 00:00:00";
|
|
|
endDate = endDate+" 23:59:59";
|
|
|
String inSql ;
|
|
|
String outSql;
|
|
|
if("0".equals(type)){
|
|
|
inSql ="SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r " +
|
|
|
" WHERE r.admin_team_id ='"+teamCode+"' " +
|
|
|
" AND r.apply_date >= '"+startDate+"' " +
|
|
|
" AND r.apply_date <='"+endDate+"' " +
|
|
|
" AND r.old_admin_team_id <> r.admin_team_id " +
|
|
|
" GROUP BY dateNo ";
|
|
|
outSql ="SELECT left(r.apply_date,10) AS dateNo,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r " +
|
|
|
" WHERE r.old_admin_team_id ='"+teamCode+"' " +
|
|
|
" AND r.apply_date >= '"+startDate+"' " +
|
|
|
" AND r.apply_date <='"+endDate+"' " +
|
|
|
" AND r.old_admin_team_id <> r.admin_team_id " +
|
|
|
" GROUP BY dateNo ";
|
|
|
}else{
|
|
|
inSql ="SELECT ( " +
|
|
|
" DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
|
|
|
" ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r " +
|
|
|
" WHERE r.admin_team_id ='"+teamCode+"' " +
|
|
|
" AND r.apply_date >= '"+startDate+"' " +
|
|
|
" AND r.apply_date <='"+endDate+"' " +
|
|
|
" AND r.old_admin_team_id <> r.admin_team_id " +
|
|
|
" GROUP BY weekOfMonth ";
|
|
|
outSql ="SELECT ( " +
|
|
|
" DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
|
|
|
" ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r " +
|
|
|
" WHERE r.old_admin_team_id ='"+teamCode+"' " +
|
|
|
" AND r.apply_date >= '"+startDate+"' " +
|
|
|
" AND r.apply_date <='"+endDate+"' " +
|
|
|
" AND r.old_admin_team_id <> r.admin_team_id " +
|
|
|
" GROUP BY weekOfMonth ";
|
|
|
}
|
|
|
JSONObject rs = new JSONObject();
|
|
|
List<Map<String,Object>> inList = jdbcTemplate.queryForList(inSql);
|
|
|
rs.put("inLine",inList);
|
|
|
List<Map<String,Object>> outList =jdbcTemplate.queryForList(outSql);
|
|
|
rs.put("outLine",outList);
|
|
|
|
|
|
return rs ;
|
|
|
}
|
|
|
}
|