| 
					
				 | 
			
			
				@ -8,6 +8,7 @@ import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.appointment.WlyySpecialDiseaseDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -23,6 +24,7 @@ import com.yihu.jw.rm.base.BaseRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.http.HttpClientUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.StringUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.hibernate.HibenateUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.mysql.query.BaseJpaService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.utils.security.MD5; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -199,6 +201,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Object queryById(String doctorId,String typeCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,Object> params = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.id AS \"id\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.NAME AS \"name\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.job_title_name AS \"jobTitleName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.introduce AS \"introduce\", " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -208,8 +211,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " b.dept_name AS \"deptName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " b.org_name AS \"orgName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " c.mapping_code AS \"jobNumber\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.disease_name AS \"diseaseName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.disease_code AS \"diseaseCode\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/*                " d.disease_name AS \"diseaseName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.disease_code AS \"diseaseCode\", " +*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " e.req_fee AS \"money\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.dept_type_code AS \"deptTypeCode\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tm.req_fee as \"twfzFee\",\n" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -229,7 +232,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN base_doctor_hospital b ON a.id = b.doctor_code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN dict_hospital_dept h ON b.dept_code = h.code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_doctor_special_disease d ON a.id = d.doctor_code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/*                " LEFT JOIN wlyy_doctor_special_disease d ON a.id = d.doctor_code " +*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_charge_dict m ON a.twfz_charge_type = m.charge_type and m.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_charge_dict n ON a.spfz_charge_type = n.charge_type and n.is_del='1'\n" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -252,30 +255,24 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        StringBuilder disease = new StringBuilder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        StringBuilder code = new StringBuilder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String diseaseName = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String diseaseCode = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (null != list && list.size() > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (list.size() == 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return  list.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (int i=0;i<list.size();i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (i == 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (list.get(i).get("diseaseName")!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            disease.append(list.get(i).get("diseaseName")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            code.append(list.get(i).get("diseaseCode")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (list.get(i).get("diseaseName")!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            disease.append(","+list.get(i).get("diseaseName")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            code.append(","+list.get(i).get("diseaseCode")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                list.get(0).put("diseaseName",disease); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                list.get(0).put("diseaseCode",code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return  list.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Map<String,Object> map = list.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<DoctorSpecialDiseaseDo> specialDiseaseDoList = specialDiseaseDao.findByDoctorCode(map.get("id").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (DoctorSpecialDiseaseDo diseaseDo:specialDiseaseDoList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                disease.append(diseaseDo.getDiseaseName()+","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                code.append(diseaseDo.getDiseaseCode()+","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("disease"+disease+"===code==="+disease); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNoneBlank(disease)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                diseaseName = disease.substring(0,disease.length()-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                diseaseCode = code.substring(0,code.length()-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            list.get(0).put("diseaseName",diseaseName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            list.get(0).put("diseaseCode",diseaseCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  list.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |