| 
					
				 | 
			
			
				@ -10,6 +10,7 @@ import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanLogDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.util.AesEncryptUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.specialist.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.Envelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.MixEnvelop; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -51,8 +52,6 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private JdbcTemplate jdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${basedb.name}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String basedb; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${encrypt.key}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String key; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private StringRedisTemplate redisTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -74,18 +73,18 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<SpecialistPatientRelationVO, SpecialistPatientRelationVO> findSpecialistPatientRelation(String doctor, Integer page, Integer size)throws ParseException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.id, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.doctor_name), '" + key + "') AS char) AS doctor_name, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.saas_id AS sassId, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patient_name, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.health_doctor AS healthDoctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.health_doctor_name), '" + key + "') AS char) AS healthDoctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.sign_code AS signCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.doctor_name","doctor_name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.saas_id AS sassId, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 AesEncryptUtils.decryptMysql("r.patient_name","patient_name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.health_doctor AS healthDoctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.health_doctor_name","healthDoctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.sign_code AS signCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.sign_year AS signYear, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.sign_doctor AS sign_doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.sign_doctor_name), '" + key + "') AS char) AS signDoctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.create_time AS createTime," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.sign_doctor AS sign_doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.sign_doctor_name","signDoctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.create_time AS createTime," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.status " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_specialist_patient_relation r " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -135,9 +134,9 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientRelationVO, PatientRelationVO> findNoLabelPatientRelation(String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " rd.create_time AS createTime ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.sex " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -175,9 +174,9 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientRelationVO, PatientRelationVO> findPatientRelatioByAssistant(String doctor , String assistant, Integer page, Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.photo ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.label_name as health, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -207,8 +206,8 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType,String teamCode, String labelCode, Integer page, Integer size,String shareDoctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(s.patient_name), '" + key + "') AS char)  AS name, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p. CODE, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p. CODE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("s.patient_name","name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL( " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "  YEAR ( " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -222,10 +221,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " lb.labelName as health, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " lb.label AS healthcode ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " s.health_assistant AS healthAssistant," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(s.health_assistant_name), '" + key + "') AS char)  AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " s.health_assistant AS healthAssistant" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("s.health_assistant_name","healthAssistantName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " s.health_assistant_name AS healthAssistantName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " s.is_manage AS isManage," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,s.is_manage AS isManage," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " s.id AS specialCode" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -252,19 +251,19 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        System.out.print("日志:"+sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("7".equals(labelType)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.CODE," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " CAST(AES_DECRYPT(from_base64(a.patient_name), '" + key + "') AS char)  AS name, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.CODE" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AesEncryptUtils.decryptMysql("a.patient_name","name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                    "c.NAME," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ",c.sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "IFNULL(YEAR (from_days(datediff(now(),c.birthday))),'未知') age," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.photo,b.disease AS label," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "b.disease_name AS labelName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "d.label_name AS health," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "d.label AS healthcode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.health_assistant AS healthAssistant," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " CAST(AES_DECRYPT(from_base64(a.health_assistant_name), '" + key + "') AS char)  AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.health_assistant AS healthAssistant" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AesEncryptUtils.decryptMysql("a.health_assistant_name","healthAssistantName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                    "a.health_assistant_name AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.is_manage AS isManage, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ",a.is_manage AS isManage, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.id AS specialCode " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM wlyy_specialist.wlyy_specialist_patient_relation a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "JOIN "+basedb+".wlyy_patient_disease_server b ON a.id=b.specialist_relation_code AND b.disease=" +labelCode+" and b.del=1 "+ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -281,16 +280,16 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("pending".equals(labelType)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.CODE," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " CAST(AES_DECRYPT(from_base64(a.patient_name), '" + key + "') AS char)  AS name, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.CODE" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AesEncryptUtils.decryptMysql("a.patient_name","name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                    "c.NAME," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ",c.sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "IFNULL(YEAR (from_days(datediff(now(),c.birthday))),'未知') age," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "c.photo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.health_assistant AS healthAssistant," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " CAST(AES_DECRYPT(from_base64(a.health_assistant_name), '" + key + "') AS char)  AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.health_assistant AS healthAssistant" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AesEncryptUtils.decryptMysql("a.health_assistant_name","healthAssistantName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                    "a.health_assistant_name AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.is_manage AS isManage " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ",a.is_manage AS isManage " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM wlyy_specialist.wlyy_specialist_patient_relation a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "JOIN "+basedb+".wlyy_patient c ON a.patient=c.CODE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " WHERE a.sign_status> 0 AND a.`status`>=0 AND (a.is_manage = 0 or a.is_manage is null)" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -346,10 +345,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(String doctor, String nameKey,String teamCode, Integer page, Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.code AS patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.code AS patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " p.`name` AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.sex ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.label_name as health, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -372,7 +371,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "' ) " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND r.status >=0  AND r.sign_status >0 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND CAST(AES_DECRYPT(from_base64 (r.patient_name),'" + key + "') AS CHAR) LIKE '%"+nameKey+"%' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND " + AesEncryptUtils.decryptMysqlNo("r.patient_name") + " LIKE '%"+nameKey+"%' "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LIMIT "+(page-1)*size+","+size; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -383,10 +382,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByNameOrIdCard(String doctor, String filter,String teamCode, Integer page, Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.code AS code, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.code AS code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " p.`name` AS name, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.sex ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.idcard ," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -410,7 +409,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "' ) " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND r.status >=0  AND r.sign_status >0 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND (CAST(AES_DECRYPT(from_base64 (r.patient_name),'" + key + "') AS CHAR) LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND (" +  AesEncryptUtils.decryptMysqlNo("r.patient_name")  + " LIKE '%"+filter+"%' OR p.idcard LIKE '%"+filter+"%') "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LIMIT "+(page-1)*size+","+size; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<PatientRelationVO> patientRelationVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientRelationVO.class)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -449,10 +448,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.code AS patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.code AS patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " p.`name` AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,p.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.sex, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.label_name as health, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -487,14 +486,14 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //1.查询该居民是否已经与该专科医生签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String checkDoctorSql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.id AS relationCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.patient_name AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code AS teamCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.team_code AS teamCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " t.`name`, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.code AS doctor," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.doctor_name), '" + key + "') AS char)  AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.code AS doctor" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " d.name AS doctorName" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_specialist_patient_relation r " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -511,17 +510,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(SpecialistTeamVO specialistTeamVO:specialistTeamVOs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String menberSql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " m.doctor_code AS doctorCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " CAST(AES_DECRYPT(from_base64(d.`name`), '" + key + "') AS char)  AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                        " d.`name` AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " "+basedb+".wlyy_admin_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " JOIN "+basedb+".wlyy_doctor d ON m.doctor_code = d.`code` " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " WHERE  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " m.available='1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND m.team_id="+specialistTeamVO.getTeamCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<AdminTeamMemberVO> adminTeamMemberVOs = jdbcTemplate.query(menberSql,new BeanPropertyRowMapper(AdminTeamMemberVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<AdminTeamMemberVO> adminTeamMemberVOs = findTeamMember(specialistTeamVO.getTeamCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                specialistTeamVO.setMembers(adminTeamMemberVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return MixEnvelop.getSuccess(SpecialistMapping.doctor_exist,specialistTeamVOs.get(0)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -530,10 +519,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //验证团队是否已经签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String checkTeamSql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.id AS relationCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.patient_name AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code AS teamCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.team_code AS teamCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " t.`name`, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -550,17 +539,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(teamVOs!=null&&teamVOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(SpecialistTeamVO specialistTeamVO:teamVOs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String menberSql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " m.doctor_code AS doctorCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " CAST(AES_DECRYPT(from_base64(d.`name`), '" + key + "') AS char)  AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                        " d.`name` AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " "+basedb+".wlyy_admin_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " JOIN "+basedb+".wlyy_doctor d ON m.doctor_code = d.`code` " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " WHERE  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " m.available='1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND m.team_id="+specialistTeamVO.getTeamCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<AdminTeamMemberVO> adminTeamMemberVOs = jdbcTemplate.query(menberSql,new BeanPropertyRowMapper(AdminTeamMemberVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<AdminTeamMemberVO> adminTeamMemberVOs = findTeamMember(specialistTeamVO.getTeamCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                specialistTeamVO.setMembers(adminTeamMemberVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return MixEnvelop.getSuccess(SpecialistMapping.team_exist,teamVOs.get(0)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -583,6 +562,20 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return MixEnvelop.getSuccess(SpecialistMapping.api_success,relationDO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<AdminTeamMemberVO> findTeamMember(Long teamId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String menberSql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " m.doctor_code AS doctorCode " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("d.name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                        " d.`name` AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " "+basedb+".wlyy_admin_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN "+basedb+".wlyy_doctor d ON m.doctor_code = d.`code` " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " WHERE  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " m.available='1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND m.team_id="+teamId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jdbcTemplate.query(menberSql,new BeanPropertyRowMapper(AdminTeamMemberVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<Boolean, Boolean> agreeSpecialistTeam(String state, String relationCode, String remark,String health_assistant,String health_assistant_name){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        SpecialistPatientRelationDO relation = specialistPatientRelationDao.findOne(relationCode); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -607,13 +600,13 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientSignInfoVO, PatientSignInfoVO> findPatientSigninfo(String code){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.patient_name AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.doctor_name), '" + key + "') AS char)  AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.doctor_name AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.hospital, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,d.hospital, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.hospital_name AS hospitalName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.dept, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -638,16 +631,16 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<SpecialistTeamVO, SpecialistTeamVO> findPatientTeamList(String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.id AS relationCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.patient_name AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code,r.sign_date , " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.team_code,r.sign_date , " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " t.`name` AS name," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " md.code AS doctor," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(md.name), '" + key + "') AS char)  AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " md.code AS doctor" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("md.name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " md.name AS doctorName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "d.hospital,d.hospital_name " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                ",d.hospital,d.hospital_name " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_specialist_patient_relation r  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN "+basedb+".wlyy_admin_team t ON t.id = r.team_code " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -661,17 +654,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(specialistTeamVOs!=null&&specialistTeamVOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(SpecialistTeamVO specialistTeamVO:specialistTeamVOs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String menberSql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " m.doctor_code AS doctorCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " CAST(AES_DECRYPT(from_base64(d.name), '" + key + "') AS char)  AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                        " d.`name` AS doctorName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " "+basedb+".wlyy_admin_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " JOIN "+basedb+".wlyy_doctor d ON m.doctor_code = d.`code` " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " WHERE  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " m.available='1' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND m.team_id="+specialistTeamVO.getTeamCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<AdminTeamMemberVO> adminTeamMemberVOs = jdbcTemplate.query(menberSql,new BeanPropertyRowMapper(AdminTeamMemberVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<AdminTeamMemberVO> adminTeamMemberVOs = findTeamMember(specialistTeamVO.getTeamCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                specialistTeamVO.setMembers(adminTeamMemberVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -682,12 +665,12 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.id AS relationCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code AS teamCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code AS teamCode" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.patient_name AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " d.name AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(d.name), '" + key + "') AS char)  AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.code AS doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("d.name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,d.code AS doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.dept, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.dept_name AS deptName, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -714,16 +697,16 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "(SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.id AS relationCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.patient, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code AS teamCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.patient_name), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.team_code AS teamCode" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.patient_name AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.health_assistant AS healthAssistant," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.health_assistant_name), '" + key + "') AS char)  AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.health_assistant AS healthAssistant" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " r.health_assistant_name AS healthAssistantName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " r.create_time AS createTime," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(d.name), '" + key + "') AS char)  AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,r.create_time AS createTime" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("d.name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                " d.name AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.code AS doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,d.code AS doctor, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.dept, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.dept_name AS deptName, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -753,10 +736,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(name)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.CODE AS CODE," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " CAST(AES_DECRYPT(from_base64(doctor.NAME), '" + key + "') AS char)  AS NAME, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.CODE AS CODE" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AesEncryptUtils.decryptMysql("doctor.name","name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                    "doctor.NAME AS NAME," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.sex AS sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ",doctor.sex AS sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.birthday AS birthday," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.photo AS photo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.mobile AS mobile," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -778,13 +761,14 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "SELECT a.doctor_health AS doctorcode FROM wlyy.wlyy_sign_family a RIGHT JOIN ( " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "SELECT patient FROM wlyy_specialist_patient_relation WHERE sign_status> 0 AND `status`>=0 AND doctor='"+doctor+"') b ON a.patient=b.patient WHERE a.`status`=1 AND a.expenses_status = 1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ") " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "t ON doctor.CODE=t.doctorcode and CAST(AES_DECRYPT(from_base64(doctor.NAME), '" + key + "') AS char)  like '%"+name+"%'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "t ON doctor.CODE=t.doctorcode and " + AesEncryptUtils.decryptMysqlNo("doctor.name")  + "  like '%"+name+"%'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.CODE AS CODE," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " CAST(AES_DECRYPT(from_base64(doctor.NAME), '" + key + "') AS char)  AS NAME, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.CODE AS CODE" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AesEncryptUtils.decryptMysql("doctor.name","name") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                    "doctor.NAME AS NAME," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.sex AS sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ",doctor.sex AS sex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.birthday AS birthday," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.photo AS photo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "doctor.mobile AS mobile," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -832,10 +816,10 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop<PatientRelationVO,PatientRelationVO> getSpecialistSignFamilyPatientByName(String specialdoctor, String familydoctor, String nameKey, Integer page, Integer size) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "p.CODE AS patient," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(p.`name`), '" + key + "') AS char)  AS patientName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "p.CODE AS patient" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("p.name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                "p.`name` AS patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "p.photo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                ",p.photo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "IFNULL(YEAR (from_days(datediff(now(),p.birthday))),'未知') age," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "p.sex " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM wlyy.wlyy_patient p " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -845,7 +829,8 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "  AND doctor='"+specialdoctor+"') " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "  AND (a.doctor='"+familydoctor+"' OR a.doctor_health='"+familydoctor+"') "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(nameKey)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql= sql + " AND CAST(AES_DECRYPT(from_base64(a.`name`), '" + key + "') AS char) LIKE '%"+nameKey+"%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql= sql + " AND " + AesEncryptUtils.decryptMysqlNo("a.name") + " LIKE '%"+nameKey+"%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql= sql +" AND a.`status`=1 AND a.expenses_status=1) s ON p.CODE=s.patient" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LIMIT "+(page-1)*size+","+size; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -862,7 +847,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "p.birthday, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "p.photo " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM (SELECT s.disease,s.disease_name,s.patient,CAST(AES_DECRYPT(from_base64(s.patient_name), '" + key + "') AS char) as patient_name,r.team_code from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM (SELECT s.disease,s.disease_name,s.patient" + AesEncryptUtils.decryptMysql("s.patient_name","patient_name") + ",r.team_code from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "(SELECT id, team_code FROM wlyy_specialist_patient_relation WHERE doctor='" + doctor + "' and sign_status > 0 and `status` >= 0) r " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "JOIN "+basedb+".wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "JOIN "+basedb+".wlyy_patient p on s.patient = p.`code` where p.`status` >0 "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -878,21 +863,6 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    public Envelop<Boolean> createSpecialists(List<SpecialistDO> info){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        specialistDao.save(info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        return Envelop.getSuccess(SpecialistMapping.api_success,true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    public Envelop<Boolean> createSpecialistArticle(SpecialistArticleDO articleDO){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        specialistArticleDao.save(articleDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        return Envelop.getSuccess(SpecialistMapping.api_success,true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    public Envelop<Boolean> createSpscialistConsult(SpecialistConsultDO consultDO){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        specialistConsultDao.save(consultDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        return Envelop.getSuccess(SpecialistMapping.api_success,true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 专科-模糊搜索注册居民(未与该医生所在团队医生签约的居民) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param doctorCode 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -997,7 +967,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        jsonObject.put("doctorInfo", jdbcTemplate.queryForMap(doctorSql)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //3、获取该医生所属团队及团队成员信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code,  CAST(AES_DECRYPT(from_base64(wd.NAME), '" + key + "') AS char)  AS doctorName  FROM " + basedb + ".wlyy_doctor wd LEFT JOIN  " + basedb + ".wlyy_admin_team_member tm ON wd. CODE = tm.doctor_code, " + basedb + ".wlyy_admin_team at " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code" + AesEncryptUtils.decryptMysql("wd.name","doctorName") + "  FROM " + basedb + ".wlyy_doctor wd LEFT JOIN  " + basedb + ".wlyy_admin_team_member tm ON wd. CODE = tm.doctor_code, " + basedb + ".wlyy_admin_team at " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE tm.team_id IN ( SELECT watm.team_id teamId FROM  " + basedb + ".wlyy_admin_team_member watm WHERE watm.doctor_code ='" + doctorCode + "'" + " AND watm.available = '1' ) AND tm.available='1' AND `at`.id=tm.team_id"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> teamList = jdbcTemplate.queryForList(teamSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<Integer, List<Map<String, Object>>> m = teamList.stream().collect(Collectors.groupingBy(tem -> ((Integer) tem.get("team_id")).intValue(), Collectors.toList())); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1048,7 +1018,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        jsonObject.put("specialistPatientRelationId", null == specialistPatientRelationDO ? null : specialistPatientRelationDO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        jsonObject.put("signCertificate", null == specialistPatientRelationDO ? null : specialistPatientRelationDO.getSignCertificate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //1、获取居民基础信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String preSql = "SELECT CAST(AES_DECRYPT(from_base64(p.name ), '" + key + "') AS char) as name, p.photo as photo,p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String preSql = "SELECT p.photo as photo" +  AesEncryptUtils.decryptMysql("p.name","name") + ", p.idcard as idcard,p.mobile as mobile,p.medicare_number as medicareNumber,p.ssc as ssc," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CASE  WHEN wd.name is null THEN '无' ELSE wd.name END as doctorName,CASE  WHEN wd.hospital_name is NULL THEN '无' ELSE wd.hospital_name END as hospitalName,CASE  WHEN wd.mobile is NULL THEN '无' ELSE wd.mobile END as doctorMobole "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String patientSql = " from " + basedb + ".wlyy_patient p LEFT JOIN " + basedb + ".wlyy_sign_family wsf " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ON p.code=wsf.patient AND wsf.type='2' AND wsf.status='1' " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1069,9 +1039,9 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        jsonObject.put("patientInfo", map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //2、获取医生信息(所属医院、科室、姓名) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String doctorSql = "SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM " + basedb + ".wlyy_doctor wd WHERE wd.code='" + doctorCode + "'";; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String doctorSql = "SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName"+AesEncryptUtils.decryptMysql("wd.name","name")+" FROM " + basedb + ".wlyy_doctor wd WHERE wd.code='" + doctorCode + "'";; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if("0".equals(signStatus)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            doctorSql="SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName,wd.name as name FROM " + basedb + ".wlyy_doctor wd WHERE wd.code='" + specialistPatientRelationDO.getDoctor() + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            doctorSql="SELECT wd.hospital_name as hospitalName,wd.dept_name as deptName"+AesEncryptUtils.decryptMysql("wd.name","name")+" FROM " + basedb + ".wlyy_doctor wd WHERE wd.code='" + specialistPatientRelationDO.getDoctor() + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,Object> result =jdbcTemplate.queryForMap(doctorSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("0".equals(signStatus) && !(doctorCode.equals(specialistPatientRelationDO.getDoctor()))) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1082,7 +1052,8 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        jsonObject.put("doctorInfo", result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //3、获取该医生所属团队及团队成员信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code,  CAST(AES_DECRYPT(from_base64(wd.NAME), '" + key + "') AS char) as doctorName  FROM " + basedb + ".wlyy_doctor wd LEFT JOIN  " + basedb + ".wlyy_admin_team_member tm ON wd. CODE = tm.doctor_code, " + basedb + ".wlyy_admin_team at " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String teamSql = "SELECT at.name teamName, tm.team_id , tm.doctor_code" + AesEncryptUtils.decryptMysql("wd.name","doctorName") + "  FROM " + basedb + ".wlyy_doctor wd LEFT JOIN  " + basedb + ".wlyy_admin_team_member tm ON wd. CODE = tm.doctor_code, " + basedb + ".wlyy_admin_team at " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE tm.team_id IN ( SELECT watm.team_id teamId FROM  " + basedb + ".wlyy_admin_team_member watm WHERE watm.doctor_code ='" + doctorCode + "'" + " AND watm.available = '1' ) AND tm.available='1' AND `at`.id=tm.team_id"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> teamList = jdbcTemplate.queryForList(teamSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<Integer, List<Map<String, Object>>> m = teamList.stream().collect(Collectors.groupingBy(tem -> ((Integer) tem.get("team_id")).intValue(), Collectors.toList())); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1201,12 +1172,14 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<SpecialistPatientRelationDO> selectByAssistant(String patient,String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "select *,CAST(AES_DECRYPT(from_base64(r.patient_name ), '" + key + "') AS char) as patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.doctor_name), '" + key + "') AS char)  AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.health_assistant_name), '" + key + "') AS char)  AS healthAssistantName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.health_doctor_name), '" + key + "') AS char)  AS healthDoctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.sign_doctor_name), '" + key + "') AS char)  AS signDoctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " CAST(AES_DECRYPT(from_base64(r.create_user_name), '" + key + "') AS char)  AS createUserName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "select *" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.patient_name","patientName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.doctor_name","doctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.health_assistant_name","healthAssistantName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.health_doctor_name","healthDoctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.sign_doctor_name","signDoctorName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                AesEncryptUtils.decryptMysql("r.create_user_name","createUserName") + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from wlyy_specialist_patient_relation r where r.health_assistant = '"+doctor+"' and r.patient = '"+patient+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SpecialistPatientRelationDO> relationDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistPatientRelationDO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return relationDOS; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1219,7 +1192,8 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop searchPatientInSpecialistNew(String doctorCode,String keywords,Integer page,Integer pageSize) throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql1 = " select count(1) as num "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql2 = " select CAST(AES_DECRYPT(from_base64(p.name ), '" + key + "') AS char) as name,p.idcard,p.code,p.photo"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql2 = " select p.idcard" + AesEncryptUtils.decryptMysql("p.name","name")  + ",p.code,p.photo"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String whereSql =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtils.isEmpty(keywords)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            whereSql+=" and  p.mobile ='"+keywords+"'"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1334,10 +1308,12 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!teamCode.equals(toTeamCode)){//跨团队 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            flag=true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql =" select CAST(AES_DECRYPT(from_base64(name), '" + key + "') AS char) as name from wlyy.wlyy_doctor where code='"+toDoctorCode+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql =" select name from wlyy.wlyy_doctor where code='"+toDoctorCode+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String toDoctorName = jdbcTemplate.queryForObject(sql,String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql =" select CAST(AES_DECRYPT(from_base64(name), '" + key + "') AS char) as name from wlyy.wlyy_doctor where code='"+doctorCode+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        toDoctorName = AesEncryptUtils.decrypt(toDoctorName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql =" select name from wlyy.wlyy_doctor where code='"+doctorCode+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String doctorName = jdbcTemplate.queryForObject(sql,String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        doctorName = AesEncryptUtils.decrypt(doctorName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONArray planObject = new JSONArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONArray planDetailObject = new JSONArray(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1346,6 +1322,7 @@ public class SpecialistService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (String patientCode:patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql ="select name from wlyy.wlyy_patient where code='"+patientCode+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String patientName = jdbcTemplate.queryForObject(sql,String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientName = AesEncryptUtils.decrypt(patientName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<PatientRehabilitationPlanDO> planList  = patientRehabilitationPlanDao.findByPatientAndCreateUserAndTeamCode(patientCode,doctorCode,Integer.parseInt(teamCode));{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (PatientRehabilitationPlanDO plan:planList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    plan.setCreateUser(toDoctorCode); 
			 |