| 
					
				 | 
			
			
				@ -469,13 +469,15 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findChild(String name,String residentialArea,String limit,JSONObject json){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT id,name,photo,idcard,CAST(IFNULL(birthday,'') AS char ) birthday,residential_area residentialArea,sex  from base_patient WHERE archive_type = 2 and del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT id,name,photo,idcard,CAST(IFNULL(birthday,'') AS char ) birthday,residential_area residentialArea" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                ",sex,IFNULL(on_line,0) online  from base_patient WHERE archive_type = 2 and del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtil.isBlank(name)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+= " and name like '%"+name+"%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtil.isBlank(residentialArea)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+= " and residential_area = '"+residentialArea+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " order by online desc"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql+=limit; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>>  list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlCount = "SELECT COUNT(*) from base_door_coach_order where `status` = 6"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -483,7 +485,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String paientId = map.get("id").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String filter = " and patient = '"+paientId+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer count = jdbcTemplate.queryForObject(sqlCount+filter,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("online",json.containsKey(paientId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            map.put("online",json.containsKey(paientId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("doorCoach",count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String idcardNo = map.get("idcard") + ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Date birthday = DateUtil.strToDate(map.get("birthday").toString()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -514,7 +516,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findOld(String name,String residentialArea,String limit,JSONObject json){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT a.id,a.name,a.photo,a.idcard,CAST(IFNULL(a.birthday,'') AS char ) birthday,a.residential_area residentialArea,a.sex " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                ", GROUP_CONCAT(DISTINCT d.category_code) deviceFlag from base_patient a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                ", GROUP_CONCAT(DISTINCT d.category_code) deviceFlag,IFNULL(on_line,0) online,IFNULL(sign_status,0) signStatus from base_patient a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_patient_device d on d.`user`=a.id  WHERE a.archive_type = 1 and a.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtil.isBlank(name)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+= " and name like '%"+name+"%' "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -522,7 +524,8 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtil.isBlank(residentialArea)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+= " and residential_area = '"+residentialArea+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " GROUP BY a.id,a.name,a.photo,a.idcard,a.birthday,a.residential_area,a.sex "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " GROUP BY a.id,a.name,a.photo,a.idcard,a.birthday,a.residential_area,a.sex,online,signStatus "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " ORDER BY online,signStatus desc"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += limit; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>>  list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlLife= "SELECT COUNT(*) from base_life_care_order where `status` = 2"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -566,10 +569,11 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findHelper(String name,String limit,JSONObject json){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT id,name,photo,sex from base_doctor WHERE doctor_level = 2 and del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT id,name,photo,sex,IFNULL(on_line,0) online from base_doctor WHERE doctor_level = 2 and del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtil.isBlank(name)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+= " and name like '%"+name+"%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " ORDER BY online desc"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql+=limit; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>>  list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlLife= "SELECT COUNT(*) from base_life_care_order where `status` = 2"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -590,7 +594,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer lifeCare = jdbcTemplate.queryForObject(sqlLife+filter,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer emergency = jdbcTemplate.queryForObject(sqlEmergency+filter,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer security = jdbcTemplate.queryForObject(sqlSecurity+filter,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("online",json.containsKey(doctorId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            map.put("online",json.containsKey(doctorId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("lifeCare",lifeCare); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("emergency",emergency); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("security",security); 
			 |