|  | @ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.common.DictService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.device.DeviceService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.family.PatientFamilyMemberService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.sign.ServicePackageService;
 | 
	
	
		
			
				|  | @ -27,6 +28,7 @@ import com.yihu.mysql.query.BaseJpaService;
 | 
	
		
			
				|  |  | import com.yihu.utils.security.MD5;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | import org.springframework.jdbc.core.BeanPropertyRowMapper;
 | 
	
		
			
				|  |  | import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | import org.springframework.transaction.annotation.Transactional;
 | 
	
	
		
			
				|  | @ -67,6 +69,10 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
 | 
	
		
			
				|  |  |     private ImUtil imUtil;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseDoctorHospitalDao doctorHospitalDao;
 | 
	
		
			
				|  |  |     @Value("${wechat.id}")
 | 
	
		
			
				|  |  |     private String wxId;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private DeviceService deviceService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 签约记录
 | 
	
	
		
			
				|  | @ -611,4 +617,15 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         patientDao.save(list);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public Map<String,Object> patientIconStatus(String patient){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex,p.pad_imei padImei " +
 | 
	
		
			
				|  |  |                 "from base_patient p INNER JOIN base_patient_wechat wc on p.id = wc.patient_id where p.del=1 and p.id='"+patient+"' and " +
 | 
	
		
			
				|  |  |                 " wc.wechat_id = '"+wxId+"' GROUP BY p.id ORDER BY wc.create_time desc";
 | 
	
		
			
				|  |  |         Map<String,Object> result = jdbcTemplate.queryForMap(sql);
 | 
	
		
			
				|  |  |         result.put("deviceType",deviceService.getPatientDeviceCategoryCode(result.get("id").toString()));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |