| 
					
				 | 
			
			
				@ -329,9 +329,13 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject res = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //医疗机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String medicalInstitutionSql = "SELECT COUNT(1) FROM base_org WHERE (type = 1 OR type = 2) AND del = 1 " + orgFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //养老机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1 and code not in ('zdjsylfwyxgszhfgs') " + orgFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //托育机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String childcareInstitutionsssSql = "SELECT COUNT(1) FROM base_org WHERE type = 4 AND del = 1" + orgFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //照料中心 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String careCenterNumSql = "SELECT COUNT(1) FROM base_org WHERE type = 6 AND del = 1" + orgFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //社工和教师注册人数 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -347,18 +351,22 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> map : list2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String archive_type = map.get("doctor_level").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer num = Integer.valueOf(map.get("c").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("1".equals(archive_type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                doctorNum = num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //社工 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("2".equals(archive_type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                helperNum = num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //助老员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("4".equals(archive_type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                helper4Num = num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //教师 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("3".equals(archive_type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                teacherNum = num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -367,7 +375,7 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer elderlyCarServiceNum = jdbcTemplate.queryForObject(elderlyCarServiceSql, Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer childcareInstitutionsssNum = jdbcTemplate.queryForObject(childcareInstitutionsssSql, Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer careCenterNum = jdbcTemplate.queryForObject(careCenterNumSql, Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        res.put("medicalInstitutionNum", medicalInstitutionNum);             //医疗结构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        res.put("medicalInstitutionNum", medicalInstitutionNum);             //医疗机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        res.put("elderlyCarServiceNum", elderlyCarServiceNum);               //养老机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        res.put("childcareInstitutionsssNum", childcareInstitutionsssNum);   //托育机构 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        res.put("careCenterNum", careCenterNum);   //照料中心 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -378,6 +386,44 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return res; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取机构列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param type 类型。1医疗机构,3养老机构,4托育机构,6照料中心 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param page 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param pageSize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param name 名字模糊搜索 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public PageEnvelop getOrgListByPage(String type,Integer page,Integer pageSize,String name){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        page = page>0?page-1:0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String orgFilter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlOrg = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> listOrg = jdbcTemplate.queryForList(sqlOrg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (listOrg.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String orgCodes = String.valueOf(listOrg.get(0).get("orgCodes")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            orgCodes = orgCodes.replaceAll(",", "','"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            orgFilter = " and code not in ('" + orgCodes + "')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String typeSql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("1".equals(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            typeSql = " and (type = 1 OR type = 2) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else if("3".equals(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            typeSql = " and type = "+type + " and code not in ('zdjsylfwyxgszhfgs')  "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            typeSql = " and type = "+type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(name)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            typeSql = typeSql + " and name like '%"+name+"%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT id,code,name,alias,type,brief,address,photo,intro,mobile FROM base_org WHERE del = 1 "+typeSql+orgFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String orderSql = " ORDER BY sort limit "+page*pageSize+","+pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String countSql = "SELECT count(*) FROM base_org WHERE del = 1 "+typeSql+orgFilter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+orderSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long count = jdbcTemplate.queryForObject(countSql,Long.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    // v0.7.0实时数据 照护对象、检测设备、紧急救助 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject realTimeDataNew() throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject res = new JSONObject(); 
			 |