|  | @ -122,11 +122,13 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |                 " a.job_title_name AS \"jobTitleName\", " +
 |  |                 " a.job_title_name AS \"jobTitleName\", " +
 | 
												
													
														
															|  |                 " a.introduce AS \"introduce\", " +
 |  |                 " a.introduce AS \"introduce\", " +
 | 
												
													
														
															|  |                 " a.expertise AS \"expertise\", " +
 |  |                 " a.expertise AS \"expertise\", " +
 | 
												
													
														
															|  | 
 |  |                 " a.photo AS \"photo\", " +
 | 
												
													
														
															|  |                 " a.outpatient_type AS \"outpatientType\", " +
 |  |                 " a.outpatient_type AS \"outpatientType\", " +
 | 
												
													
														
															|  |                 " b.dept_name AS \"deptName\", " +
 |  |                 " b.dept_name AS \"deptName\", " +
 | 
												
													
														
															|  |                 " b.org_name AS \"orgName\", " +
 |  |                 " b.org_name AS \"orgName\", " +
 | 
												
													
														
															|  |                 " c.mapping_code AS \"jobNumber\", " +
 |  |                 " c.mapping_code AS \"jobNumber\", " +
 | 
												
													
														
															|  |                 " d.disease_name AS \"diseaseName\", " +
 |  |                 " d.disease_name AS \"diseaseName\", " +
 | 
												
													
														
															|  | 
 |  |                 " d.disease_code AS \"diseaseCode\", " +
 | 
												
													
														
															|  |                 " e.req_fee AS \"money\" " +
 |  |                 " e.req_fee AS \"money\" " +
 | 
												
													
														
															|  |                 " FROM " +
 |  |                 " FROM " +
 | 
												
													
														
															|  |                 " base_doctor a " +
 |  |                 " base_doctor a " +
 | 
												
											
												
													
														
															|  | @ -156,23 +158,41 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |         String doctorId = jsonObject.get("doctorId").toString();
 |  |         String doctorId = jsonObject.get("doctorId").toString();
 | 
												
													
														
															|  |         String introduce = jsonObject.get("introduce").toString();
 |  |         String introduce = jsonObject.get("introduce").toString();
 | 
												
													
														
															|  |         String expertise = jsonObject.get("expertise").toString();
 |  |         String expertise = jsonObject.get("expertise").toString();
 | 
												
													
														
															|  | 
 |  |         String photo = jsonObject.get("photo").toString();
 | 
												
													
														
															|  |         String outpatientType = jsonObject.get("outpatientType").toString();
 |  |         String outpatientType = jsonObject.get("outpatientType").toString();
 | 
												
													
														
															|  |         String newSpecialDisease = jsonObject.get("specialDisease").toString();
 |  |         String newSpecialDisease = jsonObject.get("specialDisease").toString();
 | 
												
													
														
															|  | 
 |  |         String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
 | 
												
													
														
															|  |         //医生简介、擅长不为空
 |  |         //医生简介、擅长不为空
 | 
												
													
														
															|  |         if (null == introduce || null == expertise){
 |  |         if (null == introduce || null == expertise){
 | 
												
													
														
															|  |             return false;
 |  |             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);
 |  |             specialDiseaseDao.deleteByDoctorCode(doctorId);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         DoctorSpecialDiseaseDo specialDiseaseDo = new DoctorSpecialDiseaseDo();
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         String[] split = newSpecialDisease.split(",");
 |  |         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.setDoctorCode(doctorId);
 | 
												
													
														
															|  |             specialDiseaseDo.setDiseaseName(diseaseName);
 |  | 
 | 
												
													
														
															|  | 
 |  |             specialDiseaseDo.setDiseaseName(split[i]);
 | 
												
													
														
															|  | 
 |  |             specialDiseaseDo.setDiseaseCode(splitCode[i]);
 | 
												
													
														
															|  |             specialDiseaseDao.save(specialDiseaseDo);
 |  |             specialDiseaseDao.save(specialDiseaseDo);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 |