|  | @ -3401,21 +3401,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         String sql ="SELECT " +
 | 
	
		
			
				|  |  |                 " d.id, " +
 | 
	
		
			
				|  |  |                 " d.photo, " +
 | 
	
		
			
				|  |  |                 " d.`name`, " +
 | 
	
		
			
				|  |  |                 " d.expertise," +
 | 
	
		
			
				|  |  |                 " d.introduce," +
 | 
	
		
			
				|  |  |                 " d.job_title_code AS jobTitleCode, " +
 | 
	
		
			
				|  |  |                 " d.job_title_name AS jobTitleName," +
 | 
	
		
			
				|  |  |                 " d.charge_type AS chargeType," +
 | 
	
		
			
				|  |  |                 " h.dept_name AS deptName," +
 | 
	
		
			
				|  |  |                 " d.consult_status AS consultStatus," +
 | 
	
		
			
				|  |  |                 " d.outpatient_type AS outpatientType," +
 | 
	
		
			
				|  |  |                 " a.total as consultTotal," +
 | 
	
		
			
				|  |  |                 " h.org_name as orgName," +
 | 
	
		
			
				|  |  |                 " follow.patient as followid," +
 | 
	
		
			
				|  |  |                 " h.org_code as orgCode" +
 | 
	
		
			
				|  |  |                 " d.id AS \"id\", " +
 | 
	
		
			
				|  |  |                 " d.photo AS \"photo\", " +
 | 
	
		
			
				|  |  |                 " d.name AS \"name\", " +
 | 
	
		
			
				|  |  |                 " d.expertise AS \"expertise\"," +
 | 
	
		
			
				|  |  |                 " d.introduce AS \"introduce\"," +
 | 
	
		
			
				|  |  |                 " d.job_title_code AS \"jobTitleCode\", " +
 | 
	
		
			
				|  |  |                 " d.job_title_name AS \"jobTitleName\"," +
 | 
	
		
			
				|  |  |                 " d.charge_type AS \"chargeType\"," +
 | 
	
		
			
				|  |  |                 " h.dept_name AS \"deptName\"," +
 | 
	
		
			
				|  |  |                 " d.consult_status AS \"consultStatus\"," +
 | 
	
		
			
				|  |  |                 " d.outpatient_type AS \"outpatientType\"," +
 | 
	
		
			
				|  |  |                 " a.total AS \"consultTotal\"," +
 | 
	
		
			
				|  |  |                 " h.org_name AS \"orgName\"," +
 | 
	
		
			
				|  |  |                 " follow.patient AS \"followid\"," +
 | 
	
		
			
				|  |  |                 " h.org_code AS \"orgCode\"" +
 | 
	
		
			
				|  |  |                 " FROM " +
 | 
	
		
			
				|  |  |                 " base_doctor d " +
 | 
	
		
			
				|  |  |                 " JOIN base_doctor_hospital h ON h.doctor_code = d.id "+
 | 
	
	
		
			
				|  | @ -3427,6 +3427,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         sql +=  " WHERE  1=1 ";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         Map<String, Object> params = new HashedMap();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if(StringUtils.isBlank(chargType)){
 | 
	
		
			
				|  |  |             sql +=" AND d.charge_type is not null ";
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -3434,13 +3437,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             if("all".equals(chargType)){
 | 
	
		
			
				|  |  |                 //不过滤
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 sql+=" AND d.charge_type = '"+chargType+"'";
 | 
	
		
			
				|  |  |                 sql+=" AND d.charge_type = :chargType";
 | 
	
		
			
				|  |  |                 params.put("chargType",chargType);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(iswork)&&"1".equals(iswork)){
 | 
	
		
			
				|  |  |             logger.info("iswork:"+iswork);
 | 
	
		
			
				|  |  |             String date = DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss");
 | 
	
		
			
				|  |  |             Date date = new Date();
 | 
	
		
			
				|  |  |             sql+=" AND (" +
 | 
	
		
			
				|  |  |                     " EXISTS ( " +
 | 
	
		
			
				|  |  |                     " SELECT " +
 | 
	
	
		
			
				|  | @ -3449,28 +3453,36 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     "  wlyy_doctor_work_time t " +
 | 
	
		
			
				|  |  |                     " WHERE " +
 | 
	
		
			
				|  |  |                     "  t.doctor = d.id " +
 | 
	
		
			
				|  |  |                     " AND t.start_time <='" +date+"'" +
 | 
	
		
			
				|  |  |                     " AND t.end_time >='"+date+"'"+
 | 
	
		
			
				|  |  |                     " AND t.start_time <=:startTime" +
 | 
	
		
			
				|  |  |                     " AND t.end_time >=:endTime"+
 | 
	
		
			
				|  |  |                     " ) OR " +
 | 
	
		
			
				|  |  |                     " d.consult_status = '1') ";
 | 
	
		
			
				|  |  |             params.put("startTime",date);
 | 
	
		
			
				|  |  |             params.put("endTime",date);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(orgCode)){
 | 
	
		
			
				|  |  |             sql += " AND  h.org_code = '"+orgCode+"'";
 | 
	
		
			
				|  |  |             sql += " AND  h.org_code = :orgCode";
 | 
	
		
			
				|  |  |             params.put("orgCode",orgCode);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(diseaseKey)){
 | 
	
		
			
				|  |  |             sql+=" AND d.expertise like '%"+diseaseKey+"%'";
 | 
	
		
			
				|  |  |             sql+=" AND d.expertise like :diseaseKey";
 | 
	
		
			
				|  |  |             params.put("diseaseKey","%"+diseaseKey+"%");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(doctorNameKey)){
 | 
	
		
			
				|  |  |             sql+=" AND d.name like '%"+doctorNameKey+"%'";
 | 
	
		
			
				|  |  |             sql+=" AND d.name like :doctorNameKey";
 | 
	
		
			
				|  |  |             params.put("doctorNameKey","%"+doctorNameKey+"%");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(dept)){
 | 
	
		
			
				|  |  |             sql+=" AND h.dept_code = '"+dept+"' ";
 | 
	
		
			
				|  |  |             sql+=" AND h.dept_code = :dept ";
 | 
	
		
			
				|  |  |             params.put("dept",dept);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(jobTitleNameKey)){
 | 
	
		
			
				|  |  |             sql+=" AND d.job_title_name  = '"+jobTitleNameKey+"' ";
 | 
	
		
			
				|  |  |             sql+=" AND d.job_title_name  = :jobTitleNameKey ";
 | 
	
		
			
				|  |  |             params.put("jobTitleNameKey",jobTitleNameKey);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(outpatientType)){
 | 
	
	
		
			
				|  | @ -3497,17 +3509,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(workingTime)){
 | 
	
		
			
				|  |  |             sql+=" AND wk.date = '"+workingTime+"' ";
 | 
	
		
			
				|  |  |             sql+=" AND wk.date = :workingTime ";
 | 
	
		
			
				|  |  |             params.put("workingTime",workingTime);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(consultStatus)){
 | 
	
		
			
				|  |  |             sql+=" AND d.consult_status = '"+consultStatus+"' ";
 | 
	
		
			
				|  |  |             sql+=" AND d.consult_status = :consultStatus ";
 | 
	
		
			
				|  |  |             params.put("consultStatus",consultStatus);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         sql += " and d.del='1' order by a.total "+ consutlSort +" limit "+page * pagesize +","+pagesize;
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         sql += " and d.del='1' order by a.total "+ consutlSort;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,pagesize);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         logger.info("findDoctorByHospitalAndDiseaseAndDept end:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
 | 
	
		
			
				|  |  |         logger.info("sql:"+sql);
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -3520,7 +3536,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public List<Map<String,Object>> findHotDeptAndDiseaseDict(String dictName) {
 | 
	
		
			
				|  |  |         String sql ="SELECT * from wlyy_hospital_sys_dict where dict_name='"+dictName+"' ORDER BY sort ASC;";
 | 
	
		
			
				|  |  |         String sql ="SELECT * from wlyy_hospital_sys_dict where dict_name='"+dictName+"' ORDER BY sort ASC";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         
 |