|  | @ -242,8 +242,57 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
 | 
												
													
														
															|  |         return ListEnvelop.getSuccess(SpecialistMapping.api_success, resultList);
 |  |         return ListEnvelop.getSuccess(SpecialistMapping.api_success, resultList);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     /**
 | 
												
													
														
															|  | 
 |  |      * 查询专病中心列表
 | 
												
													
														
															|  | 
 |  |      */
 | 
												
													
														
															|  | 
 |  |     public MixEnvelop selectByCondition(String name, Integer page, Integer size){
 | 
												
													
														
															|  | 
 |  |         String orderBy = "  order by sort asc,create_time desc limit "+(page-1)*size+","+size;
 | 
												
													
														
															|  | 
 |  |         String condition = " ";
 | 
												
													
														
															|  | 
 |  |         String sql = "SELECT\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tid,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tname,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tphoto,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tbanner,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tdescription,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tstatus,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tdept,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tsort,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tdept_name AS deptName,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tdiagnosis,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tdiagnosis_name AS diagnosisName,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tis_disease AS isDisease,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tplan_doctor AS planDoctor,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tplan_doctor_name AS planDoctorName,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tarticle_relation as articleRelation,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tarticle_relation_name as articleRelationName,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tis_family as isFamily,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tfamily_relation as familyRelation,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tfamily_relation_name as familyRelationName,\n" +
 | 
												
													
														
															|  | 
 |  |                 "\trehabilitation_type 'rehabilitationType'," +
 | 
												
													
														
															|  | 
 |  |                 "\trehabilitation_down_type 'rehabilitationDownType'," +
 | 
												
													
														
															|  | 
 |  |                 "\trehabilitation_template_id 'rehabilitationTemplateId'\n" +
 | 
												
													
														
															|  | 
 |  |                 "FROM\n" +
 | 
												
													
														
															|  | 
 |  |                 "\tbase_disease_hospital dh where dh.status='1' and rehabilitation_type='1' ";
 | 
												
													
														
															|  | 
 |  |         if (StringUtils.isNoneBlank(name)){
 | 
												
													
														
															|  | 
 |  |             condition +=" and name like '%"+name+"%' ";
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+condition+orderBy);
 | 
												
													
														
															|  | 
 |  |         String sqlCount ="select COUNT(1) as total from base_disease_hospital where 1=1 ";
 | 
												
													
														
															|  | 
 |  |         Long count = jdbcTemplate.queryForObject(sqlCount+condition,Long.class);
 | 
												
													
														
															|  | 
 |  |         return MixEnvelop.getSuccessListWithPage("success", list, page, size, count);
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     //创建康复计划
 |  |     //创建康复计划
 | 
												
													
														
															|  |     public PatientRehabilitationPlanDO createPatientRehabilitationPlan(PatientRehabilitationPlanDO planDO,List<RehabilitationDetailDO> details) {
 |  |     public PatientRehabilitationPlanDO createPatientRehabilitationPlan(PatientRehabilitationPlanDO planDO,List<RehabilitationDetailDO> details) {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         String sql = "SELECT t.plan_doctor,t.plan_doctor_name from wlyy_rehabilitation_plan_template t,base_disease_hospital d " +
 | 
												
													
														
															|  | 
 |  |                 "WHERE d.id='"+planDO.getDisease()+"' and t.id =d.rehabilitation_template_id ";
 | 
												
													
														
															|  | 
 |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 | 
												
													
														
															|  | 
 |  |         if(list.size()>0){
 | 
												
													
														
															|  | 
 |  |             planDO.setPlanDoctor(list.get(0).get("plan_doctor")+"");
 | 
												
													
														
															|  | 
 |  |             planDO.setPlanDoctorName(list.get(0).get("plan_doctor_name")+"");
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         String patientInfoCode = planDO.getPatientInfoCode();
 |  |         String patientInfoCode = planDO.getPatientInfoCode();
 | 
												
													
														
															|  |         planDO.setStatus(3);//待分配 执行医生和科室
 |  |         planDO.setStatus(3);//待分配 执行医生和科室
 | 
												
													
														
															|  |         planDO.setTitle(planDO.getName()+"的康复计划");
 |  |         planDO.setTitle(planDO.getName()+"的康复计划");
 |