| 
					
				 | 
			
			
				@ -2365,11 +2365,10 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer count = jdbcTemplate.queryForObject(sql,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("doctorCount",count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = " SELECT count(o.bussiness_id) " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM ( SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM base_security_monitoring_order o UNION ALL  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM base_emergency_assistance_order o " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ") o WHERE 1=1  and dept='"+teamId+"' and `status` in (-2,0,1) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM (  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_security_monitoring_order o  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " UNION ALL  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_emergency_assistance_order o " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  )o  "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Long emeAssistanceCount = jdbcTemplate.queryForObject(sql,Long.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("emeAssistanceCount",emeAssistanceCount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = " SELECT count(o.id) FROM base_life_care_order o WHERE o.status<>0 and o.status<>-1  and EXISTS ( " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2401,11 +2400,11 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                orgCodes = orgCodes.replaceAll(",","','"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                filter = " and a.id not in ('"+orgCodes+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.sign_status=1 and a.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and EXISTS ( select 1 from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+teamId+"' ) "+filter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8) = a.id and r.team_code='"+teamId+"' ) "+filter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            count =  jdbcTemplate.queryForObject(sql,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("oldTotal",count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //照护老人数量 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2464,11 +2463,10 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer count = jdbcTemplate.queryForObject(sql,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("doctorCount",count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = " SELECT count(o.bussiness_id) " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM ( SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM base_security_monitoring_order o UNION ALL  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM base_emergency_assistance_order o " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ") o WHERE 1=1  and dept='"+teamId+"' and `status` in (-2,0,1) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM (  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_security_monitoring_order o  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " UNION ALL  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_emergency_assistance_order o " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  )o  "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Long emeAssistanceCount = jdbcTemplate.queryForObject(sql,Long.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("emeAssistanceCount",emeAssistanceCount);//救助服务 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = " SELECT count(o.id) FROM base_life_care_order o WHERE o.status<>0 and o.status<>-1  and EXISTS ( " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2501,7 +2499,7 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                orgCodes = orgCodes.replaceAll(",","','"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                filter = " and a.id not in ('"+orgCodes+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.sign_status=1 and a.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and EXISTS ( select 1 from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " + 
			 |