| 
					
				 | 
			
			
				@ -476,7 +476,7 @@ public class RehabilitationManageService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (int i=1;i<planIdlist.length;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            planCondition .append(",'"+planIdlist[i]+"'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,i.name from wlyy_specialist.wlyy_rehabilitation_plan_detail d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,i.name,1 as flag from wlyy_specialist.wlyy_rehabilitation_plan_detail d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where  d.plan_id in ("+planCondition+" )AND  d.execute_time IS NOT NULL  and d.execute_time <>'' " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(searchTask!=null){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -508,21 +508,21 @@ public class RehabilitationManageService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> patientCodeList = jdbcTemplate.queryForList(planPatientSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (list.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String patient =  list.get(0).get("patient").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (7 == searchTask){ //处方续方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String cfxfSql = "SELECT LEFT ( pr.create_time, 19 ) AS createTime ,LEFT ( pr.pres_create_time, 19 ) AS buildCreateTime , pr.doctor AS doctorCode, pr.doctor_name AS doctorNmae,pr.`status`," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " pr.hospital_name, pr.hospital, p.`name` AS patientName,p.code AS patientCode,pr.`code` AS id,7 as code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " FROM  wlyy_prescription pr  LEFT JOIN wlyy_patient p ON pr.patient = p.`code` WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientCodeList.size()>0&&null!=searchTask) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String patient =  patientCodeList.get(0).get("patient").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (7 == searchTask){ //处方续方 flag 用于判断 1.7.0.5 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String cfxfSql = "SELECT LEFT ( pr.create_time, 19 ) AS executeTime ,LEFT ( pr.pres_create_time, 19 ) AS buildCreateTime , pr.doctor AS doctorCode, pr.doctor_name AS doctorNmae,pr.`status`," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " pr.hospital_name, pr.hospital, p.`name` AS patientName,p.code AS patientCode,pr.`code` AS id,7 as code, 2 as flag " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " FROM  wlyy.wlyy_prescription pr  LEFT JOIN wlyy.wlyy_patient p ON pr.patient = p.`code` WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "  1 = 1  AND pr.STATUS = '100' AND p.code= '"+patient+"' GROUP BY  pr.CODE "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                list = jdbcTemplate.queryForList(cfxfSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (6 == searchTask){ //随访 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String sfSql = "SELECT DISTINCT wf.followup_date followupDate,wf.followup_plan_date followupPlanDate,wf.doctor_code doctorCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String sfSql = "SELECT DISTINCT DATE_FORMAT(wf.followup_date,'%Y/%m/%d %H:%i') followupDate,DATE_FORMAT(wf.followup_plan_date,'%Y/%m/%d %H:%i') executeTime,wf.doctor_code doctorCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " wf.patient_code AS patientCode,wf.patient_name AS patientName,wf.doctor_name doctorName,wf.`status` AS `status`,wf.org_name orgName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " wf.org_code orgCode,sd.value AS `value`, wf.followup_type  followupType,wf.id AS id, 6 AS code FROM  wlyy_followup wf " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " LEFT JOIN system_dict sd ON wf.followup_type = sd.CODE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " wf.org_code orgCode,sd.value AS `value`, wf.followup_type  followupType,wf.id AS id, 6 AS code,2 as flag FROM  wlyy.wlyy_followup wf " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " LEFT JOIN wlyy.system_dict sd ON wf.followup_type = sd.CODE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND sd.dict_name = 'FOLLOWUP_WAY_DICT' WHERE wf.status !=0  AND wf.patient_code = '"+patient+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                list = jdbcTemplate.queryForList(sfSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 |