|
@ -3682,7 +3682,7 @@ public class FamilyContractService extends BaseService {
|
|
|
for(Map<String,Object> map :serlist){
|
|
|
String labelCode = (String)map.get("labelCode");
|
|
|
List<Map<String,String>> codes = new ArrayList<>();
|
|
|
Iterator iterator = patientList.iterator();
|
|
|
Iterator iterator = totalList.iterator();
|
|
|
while(iterator.hasNext()){
|
|
|
Map<String,Object> p = ( Map<String,Object>)iterator.next();
|
|
|
String serverType = p.get("serverType") ==null?"":((String)p.get("serverType"));
|
|
@ -3725,11 +3725,72 @@ public class FamilyContractService extends BaseService {
|
|
|
" f.`status` >= 0 " +
|
|
|
" AND f.admin_team_code = ? " +
|
|
|
" AND f.doctor_health IS NULL " +
|
|
|
" AND f.sick_village IS NOT NULL "+
|
|
|
" GROUP BY " +
|
|
|
" f.sick_village " +
|
|
|
" ORDER BY " +
|
|
|
" number DESC ";
|
|
|
List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientSql,new Object[]{teamCode});
|
|
|
if(patientList!=null&&patientList.size()>0){
|
|
|
for(Map<String,Object> map : patientList){
|
|
|
String labelCode = (String)map.get("labelCode");
|
|
|
if(StringUtils.isNotBlank(labelCode)){
|
|
|
List<Map<String,String>> codes = new ArrayList<>();
|
|
|
Iterator iterator = totalList.iterator();
|
|
|
while(iterator.hasNext()){
|
|
|
Map<String,Object> p = ( Map<String,Object>)iterator.next();
|
|
|
String lbCode = p.get("labelCode") ==null?"":((String)p.get("labelCode"));
|
|
|
if(labelCode.equals(lbCode)){
|
|
|
Map<String,String> code = new HashMap<>();
|
|
|
code.put("code",(String)p.get("patient"));
|
|
|
codes.add(code);
|
|
|
iterator.remove();
|
|
|
}
|
|
|
}
|
|
|
map.put("codes",codes);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
rs.put("patients",patientList);
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public JSONObject getTeamCountryPatientChangeDoctorList(Long teamCode,String level,String oldDoctorCode){
|
|
|
String totalSql = " SELECT " +
|
|
|
" s.patient,ifnull(s.sick_village,0) as labelCode" +
|
|
|
" FROM " +
|
|
|
" wlyy_sign_family s " +
|
|
|
" WHERE " +
|
|
|
" s.`status` >= 0 " +
|
|
|
" AND s.admin_team_code = ? ";
|
|
|
if("2".equals(level)){
|
|
|
totalSql = totalSql+" AND s.doctor ='"+oldDoctorCode+"'";
|
|
|
}else{
|
|
|
totalSql = totalSql+" AND s.doctor_health ='"+oldDoctorCode+"'";
|
|
|
}
|
|
|
JSONObject rs = new JSONObject();
|
|
|
List<Map<String,Object>> totalList = jdbcTemplate.queryForList(totalSql,new Object[]{teamCode});
|
|
|
rs.put("count",(totalList!=null&&totalList.size()>0)?totalList.size():0);
|
|
|
String patientSql ="SELECT " +
|
|
|
" f.sick_village AS labelCode, " +
|
|
|
" f.sick_village_name AS label, " +
|
|
|
" COUNT(1) AS number " +
|
|
|
" FROM " +
|
|
|
" wlyy_sign_family f " +
|
|
|
" WHERE " +
|
|
|
" f.`status` >= 0 " +
|
|
|
" AND f.sick_village IS NOT NULL "+
|
|
|
" AND f.admin_team_code = ? " ;
|
|
|
if("2".equals(level)){
|
|
|
patientSql = patientSql+" AND s.doctor ='"+oldDoctorCode+"'";
|
|
|
}else{
|
|
|
patientSql = patientSql+" AND s.doctor_health ='"+oldDoctorCode+"'";
|
|
|
}
|
|
|
patientSql = patientSql+" GROUP BY " +
|
|
|
" f.sick_village " +
|
|
|
" ORDER BY " +
|
|
|
" number DESC ";
|
|
|
List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientSql,new Object[]{teamCode});
|
|
|
if(patientList!=null&&patientList.size()>0){
|
|
|
for(Map<String,Object> map : patientList){
|
|
|
String labelCode = (String)map.get("labelCode");
|