| 
					
				 | 
			
			
				@ -9,6 +9,8 @@ import com.yihu.jw.care.service.device.DeviceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.device.PatientDeviceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.role.RoleService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.sign.ServicePackageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.doctor.dao.BaseDoctorDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseOrgDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BasePatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.care.device.DeviceDetail; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -67,6 +69,8 @@ public class DetectionPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private ServicePackageService servicePackageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private RoleService roleService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseDoctorDao doctorDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -549,27 +553,27 @@ public class DetectionPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object >> findSignOlder(String doctorId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        /*String sql=  "SELECT p.id,p.name,p.photo,p.idcard,CAST(IFNULL(p.birthday,'') AS char ) birthday,p.residential_area residentialArea,p.sex, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.ykt_id yktId, case 1 WHEN p.openid is not null then 1 WHEN p.on_line = '1' then 1 ELSE 0 end as online,IFNULL(p.sign_status,0) signStatus "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from base_service_package_sign_record sr,base_patient p,base_service_package_record r,base_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE sr.status=1 and sr.patient = p.id and m.team_code = r.team_code and sr.id=r.sign_id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " and m.del = '1' and  p.del = '1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " GROUP BY p.id,p.name,p.photo,p.idcard,p.birthday,p.residential_area,p.sex,p.ykt_id,online,signStatus" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ORDER BY online desc,p.ykt_id desc,signStatus desc ";*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql=  "SELECT p.id,p.name,p.photo,p.idcard,CAST(IFNULL(p.birthday,'') AS char ) birthday,p.residential_area residentialArea,p.sex, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.ykt_id yktId, case 1 WHEN p.openid is not null then 1 WHEN p.on_line = '1' then 1 ELSE 0 end as online,IFNULL(p.sign_status,0) signStatus "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from base_service_package_sign_record sr,base_patient p,base_service_package_record r,base_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE sr.status=1 and sr.patient = p.id and m.team_code = r.team_code and sr.id=r.sign_id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "and m.doctor_code = '"+doctorId+"' and m.del = '1' and  p.del = '1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " GROUP BY p.id,p.name,p.photo,p.idcard,p.birthday,p.residential_area,p.sex,p.ykt_id,online,signStatus" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ORDER BY online desc,p.ykt_id desc,signStatus desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex,p.pad_imei padImei,p.residential_area residentialArea  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " from base_service_package_sign_record sr,base_patient p,base_service_package_record r,base_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                "WHERE sr.status=1 and sr.patient = p.id and m.team_code = r.team_code and sr.id=r.sign_id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                "and m.doctor_code = '"+doctorId+"' and m.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseDoctorDO doctorDO = doctorDao.findById(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (doctorDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (2==doctorDO.getLevel()){//社工 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql=  "SELECT p.id,p.name,p.photo,p.idcard,CAST(IFNULL(p.birthday,'') AS char ) birthday,p.residential_area residentialArea,p.sex, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " p.ykt_id yktId, case 1 WHEN p.openid is not null then 1 WHEN p.on_line = '1' then 1 ELSE 0 end as online,IFNULL(p.sign_status,0) signStatus "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " from base_service_package_sign_record sr,base_patient p,base_service_package_record r,base_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE sr.status=1 and sr.patient = p.id and m.team_code = r.team_code and sr.id=r.sign_id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "and m.doctor_code = '"+doctorId+"' and m.del = '1' and  p.del = '1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " GROUP BY p.id,p.name,p.photo,p.idcard,p.birthday,p.residential_area,p.sex,p.ykt_id,online,signStatus" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " ORDER BY online desc,p.ykt_id desc,signStatus desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else if (4==doctorDO.getLevel()){//助老员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = " SELECT p.id,p.name,p.photo,p.idcard,CAST(IFNULL(p.birthday,'') AS char ) birthday,p.residential_area residentialArea, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  " p.sex,p.ykt_id yktId, case 1 WHEN p.openid is not null then 1 WHEN p.on_line = '1' then 1 ELSE 0 end as online,IFNULL(p.sign_status,0) signStatus " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  " from base_patient p,base_patient_helper ph " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  " where p.id = ph.patient and p.del=1 and ph.del=1 and ph.doctor='"+doctorId+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlLife= "SELECT COUNT(*) from base_life_care_order "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlEmergency= "SELECT COUNT(*) from base_emergency_assistance_order "; 
			 |