| 
					
				 | 
			
			
				@ -781,7 +781,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param residentialArea 居住小区 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject findUserByType(String type,String name,String residentialArea,String area,Integer level,Integer page,Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject findUserByType(String type,String name,String residentialArea,String area,Integer level,Integer page,Integer size,boolean isShow){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject re = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(page == null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            page = 1; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -792,7 +792,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String limit = " limit "+(page-1)*size+","+size; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String filter =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("1".equals(type)||StringUtil.isBlank(type)){//新生儿 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("1".equals(type)||StringUtil.isBlank(type)||isShow){//新生儿 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(listtmp.size()>0){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -805,7 +805,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("child",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("childTotal",findChildTotal(name,residentialArea,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("2".equals(type)||"8".equals(type)||StringUtil.isBlank(type)){//老人  //1.7.7增加  需照护老人(孤/独/空)800 + 老人名单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(("2".equals(type)||StringUtil.isBlank(type))||(isShow&&"2".equals(type))){//老人  //1.7.7增加  需照护老人(孤/独/空)800 + 老人名单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_older' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -819,7 +819,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("old",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("oldTotal",findOldTotal(type,name,residentialArea,area,level,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("3".equals(type)||StringUtil.isBlank(type)){//社工 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("3".equals(type)||StringUtil.isBlank(type)||isShow){//社工 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -833,22 +833,24 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("helperTotal",findHelperTotal(name,area,level,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("4".equals(type)||StringUtils.isBlank(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("4".equals(type)||StringUtils.isBlank(type)||isShow){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String nameDoctorSql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotBlank(name))nameDoctorSql = " and d.name like '%"+name+"%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String testDoctorSql= " SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_doctor'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String doctorSql = "SELECT d.id,d.photo,d.`name`,d.openid,h.org_name FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "base_doctor d,base_doctor_hospital h WHERE d.id=h.doctor_code" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND h.del = 1 AND d.del = 1 AND d.doctor_level = 1 AND d.id NOT IN ("+testDoctorSql+")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND h.del = 1 AND d.del = 1 AND d.doctor_level = 1 "+nameDoctorSql+" AND d.id NOT IN ("+testDoctorSql+")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String doctorTotalSql = "SELECT count(d.id) total FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "base_doctor d,base_doctor_hospital h WHERE d.id=h.doctor_code" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND h.del = 1 AND d.del = 1 AND d.doctor_level = 1 AND d.id NOT IN ("+testDoctorSql+")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND h.del = 1 AND d.del = 1 AND d.doctor_level = 1 "+nameDoctorSql+" AND d.id NOT IN ("+testDoctorSql+")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String, Object>> list = jdbcTemplate.queryForList(doctorSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer integer = jdbcTemplate.queryForObject(doctorTotalSql, Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("doctor",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("doctorTotal",integer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("5".equals(type)||StringUtils.isBlank(type)){//老人家属 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("5".equals(type)||StringUtils.isBlank(type)||isShow){//老人家属 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_olderRelative' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -861,7 +863,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("oldFamily",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("oldFamilyCount",findOlderFamilyTotal(name,area,level,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("6".equals(type)||StringUtils.isBlank(type)){//助老员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("6".equals(type)||StringUtils.isBlank(type)||isShow){//助老员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -875,7 +877,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("helper4",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("helper4Total",findHelper4Total(name,area,level,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("7".equals(type)||StringUtils.isBlank(type)){//街道老人 第三方同步过来的朝晖街道老人数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(("7".equals(type)||StringUtils.isBlank(type))||(isShow&&"7".equals(type))){//街道老人 第三方同步过来的朝晖街道老人数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_older' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -889,6 +891,20 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("unSignOld",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("unSignOldCount",findUnSignOldTotal(name,residentialArea,area,level,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(("8".equals(type)||StringUtil.isBlank(type))||(isShow&&"7".equals(type))){//1.7.7增加  需照护老人(孤/独/空)800 + 老人名单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_older' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(listtmp.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                orgCodes = orgCodes.replaceAll(",","','"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                filter = " and a.id not in ('"+orgCodes+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> list = findOld(type,name,residentialArea,area,level,limit,filter); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("old",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.put("oldTotal",findOldTotal(type,name,residentialArea,area,level,filter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return re; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |