|  | @ -391,7 +391,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
 | 
	
		
			
				|  |  |         return page;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public List<Map<String , Object>> findDeviceFromAdmin(String doctor,String patientName, int page, int pageSize) {
 | 
	
		
			
				|  |  |     public List<Map<String , Object>> findDeviceFromAdmin(String doctor,String patientName,String categoryCode, int page, int pageSize) {
 | 
	
		
			
				|  |  |         String sql = "select Distinct p.id,p.`name`,dd.photo,pd.device_id deviceId,pd.category_code categoryCode,pd.device_name deviceName, " +
 | 
	
		
			
				|  |  |                 " pd.device_sn deviceSn,pd.czrq,pd.doctor,pd.doctor_name doctorName,pd.agent,pd.agent_name agentName " +
 | 
	
		
			
				|  |  |                 " from wlyy_patient_device pd,wlyy_devices wd,base_patient p,dm_device dd where p.id = pd.`user`  and pd.del = 0 " +
 | 
	
	
		
			
				|  | @ -399,6 +399,9 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(patientName)){
 | 
	
		
			
				|  |  |             sql += " AND (p.`name` LIKE '%" + patientName +"%' or  p.idcard LIKE '%" + patientName + "%') ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(categoryCode)){
 | 
	
		
			
				|  |  |             sql+= " and pd.category_code ='"+categoryCode+"'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(doctor)){//著老远查看时之查看签约居民的绑定
 | 
	
		
			
				|  |  |             sql += " and EXISTS (SELECT sr.patient from base_service_package_sign_record sr,base_service_package_record r,base_team_member m " +
 | 
	
		
			
				|  |  |                     " WHERE sr.patient = p.id and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id " +
 |