| 
					
				 | 
			
			
				@ -122,11 +122,13 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.job_title_name AS \"jobTitleName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.introduce AS \"introduce\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.expertise AS \"expertise\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.photo AS \"photo\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.outpatient_type AS \"outpatientType\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " 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\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " e.req_fee AS \"money\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " base_doctor a " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -156,23 +158,41 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String doctorId = jsonObject.get("doctorId").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String introduce = jsonObject.get("introduce").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String expertise = jsonObject.get("expertise").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String photo = jsonObject.get("photo").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String outpatientType = jsonObject.get("outpatientType").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String newSpecialDisease = jsonObject.get("specialDisease").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //医生简介、擅长不为空 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (null == introduce || null == expertise){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        baseDoctorDao.update(doctorId,introduce,expertise,outpatientType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //删除医生旧专病门诊,保存新专病门诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DoctorSpecialDiseaseDo> oldSpecialDisease = specialDiseaseDao.findByDoctorCode(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (null != oldSpecialDisease && oldSpecialDisease.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //List<DoctorSpecialDiseaseDo> oldSpecialDisease = specialDiseaseDao.findByDoctorCode(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,Object> params = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlTotal ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " COUNT(1) AS \"total\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_doctor_special_disease a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " 1 = 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sqlTotal += " AND a.doctor_code =:doctorId"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("doctorId",doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long count = 0L; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> total = hibenateUtils.createSQLQuery(sqlTotal, params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        count = hibenateUtils.objTransformLong(total.get(0).get("total")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (count > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            specialDiseaseDao.deleteByDoctorCode(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DoctorSpecialDiseaseDo specialDiseaseDo = new DoctorSpecialDiseaseDo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String[] split = newSpecialDisease.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (String diseaseName : split) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String[] splitCode = newSpecialDiseaseCode.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (int i=0;i<split.length;i++ ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DoctorSpecialDiseaseDo specialDiseaseDo = new DoctorSpecialDiseaseDo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            specialDiseaseDo.setDoctorCode(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            specialDiseaseDo.setDiseaseName(diseaseName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            specialDiseaseDo.setDiseaseName(split[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            specialDiseaseDo.setDiseaseCode(splitCode[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            specialDiseaseDao.save(specialDiseaseDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |