|  | @ -66,16 +66,19 @@ public class RehabilitationManageService {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public MixEnvelop<Map<String,Object>, Map<String,Object>> findRehabilitationPlan(Integer doctorType,String doctorCode, String diseaseCode, Integer planType,Integer todaybacklog, String patientCondition,Integer page, Integer pageSize) throws Exception{
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String leftSql =" join "+basedb+".wlyy_sign_family f on f.patient=p.patient and f.expenses_status='1' and f.status=1 ";
 | 
	
		
			
				|  |  | //        if(StringUtils.isNotEmpty(diseaseCode)){
 | 
	
		
			
				|  |  | //            leftSql += " left join "+basedb+".wlyy_patient_disease_server s on p.patient=s.patient and s.del=1 and s.disease ='"+diseaseCode+"'" ;
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  |         String leftSql = "";
 | 
	
		
			
				|  |  |         String sql = " select p.*  from wlyy_specialist.wlyy_patient_rehabilitation_plan p  " ;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if(doctorType==2){//家医是根据签约关系过滤
 | 
	
		
			
				|  |  |             leftSql =" join "+basedb+".wlyy_sign_family f on f.patient=p.patient and f.expenses_status='1' and f.status=1 ";
 | 
	
		
			
				|  |  |             leftSql+=" and (f.doctor='"+doctorCode+"' or f.doctor_health='"+doctorCode+"') ";
 | 
	
		
			
				|  |  |             sql.replace("from", ",f.idcard,f.hospital_name from");
 | 
	
		
			
				|  |  |             sql += leftSql;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         String sql = " select p.*,f.idcard,f.hospital_name from wlyy_specialist.wlyy_patient_rehabilitation_plan p  " +leftSql+
 | 
	
		
			
				|  |  |                 " where 1=1 " ;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         sql += " where p.`status` > 0 ";
 | 
	
		
			
				|  |  |         if(planType!=null){
 | 
	
		
			
				|  |  |             sql += " and p.plan_type="+planType;
 | 
	
		
			
				|  |  |         }
 |