|  | @ -932,7 +932,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             totalSql+= " AND d.charge_type is not null ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(outpatientType)){
 | 
	
		
			
				|  |  |             totalSql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
 | 
	
		
			
				|  |  |             if(outpatientType.contains("or")){
 | 
	
		
			
				|  |  |                 String[] outpatientTypeArray = outpatientType.split("or");
 | 
	
		
			
				|  |  |                 totalSql+= " AND ( ";
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |                 for (int i = 0; i < outpatientTypeArray.length; i++) {
 | 
	
		
			
				|  |  |                     totalSql +=" d.outpatient_type like'%"+outpatientTypeArray[i]+"%'";
 | 
	
		
			
				|  |  |                     if(i != outpatientTypeArray.length -1){
 | 
	
		
			
				|  |  |                         totalSql += " or ";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 totalSql+= "  ) ";
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 totalSql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             totalSql+=" AND d.outpatient_type is not null ";
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -985,16 +998,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(orgCode)){
 | 
	
		
			
				|  |  |             sql+= " AND h.org_code = '"+orgCode+"'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(chargeType)){
 | 
	
		
			
				|  |  |             sql+= " AND d.charge_type ='"+chargeType+"'";
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             sql+= " AND d.charge_type is not null";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(outpatientType)){
 | 
	
		
			
				|  |  |             sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
 | 
	
		
			
				|  |  |             if(outpatientType.contains("or")){
 | 
	
		
			
				|  |  |                 String[] outpatientTypeArray = outpatientType.split("or");
 | 
	
		
			
				|  |  |                 sql+= " AND ( ";
 | 
	
		
			
				|  |  |             
 | 
	
		
			
				|  |  |                 for (int i = 0; i < outpatientTypeArray.length; i++) {
 | 
	
		
			
				|  |  |                     sql +=" d.outpatient_type like'%"+outpatientTypeArray[i]+"%'";
 | 
	
		
			
				|  |  |                     if(i != outpatientTypeArray.length -1){
 | 
	
		
			
				|  |  |                         sql += " or ";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 sql+= " ) ";
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             sql+= " AND d.outpatient_type is not null ";
 | 
	
		
			
				|  |  |             sql+=" AND d.outpatient_type is not null ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(key)){
 | 
	
		
			
				|  |  |             sql+=" AND (h.dept_name like '%"+key+"%' OR d.name like '%"+key+"%' OR d.expertise like '%"+key+"%') ";
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -1013,7 +1042,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     " AND t.start_time <='"+endDate+"'"+
 | 
	
		
			
				|  |  |                     " )";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         sql += " AND d.del='1'AND d.charge_type is not null AND d.outpatient_type is not null LIMIT " + (page - 1) * size + "," + size + "";
 | 
	
		
			
				|  |  |         sql += " AND d.del='1' AND d.outpatient_type is not null LIMIT " + (page - 1) * size + "," + size + "";
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         if(list!=null&&list.size()>0){
 | 
	
		
			
				|  |  |             //获取排班
 | 
	
	
		
			
				|  | @ -2880,7 +2909,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(outpatientType)){
 | 
	
		
			
				|  |  |             sql+=" AND d.outpatient_type like '%"+outpatientType+"%' ";
 | 
	
		
			
				|  |  |             if(outpatientType.contains("or")){
 | 
	
		
			
				|  |  |                 String[] outpatientTypeArray = outpatientType.split("or");
 | 
	
		
			
				|  |  |                 sql+= " AND ( ";
 | 
	
		
			
				|  |  |             
 | 
	
		
			
				|  |  |                 for (int i = 0; i < outpatientTypeArray.length; i++) {
 | 
	
		
			
				|  |  |                     sql +=" d.outpatient_type like'%"+outpatientTypeArray[i]+"%'";
 | 
	
		
			
				|  |  |                     if(i != outpatientTypeArray.length -1){
 | 
	
		
			
				|  |  |                         sql += " or ";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 sql+= " ) ";
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             sql+=" AND d.outpatient_type is not null ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(keyName)){
 | 
	
	
		
			
				|  | @ -2896,7 +2940,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             sql+=" AND d.consult_status = '"+consultStatus+"' ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         sql += " and d.del='1' and d.charge_type is not null  AND d.outpatient_type is not null order by a.total "+ consutlSort +" limit "+page * pagesize +","+pagesize;
 | 
	
		
			
				|  |  |         sql += " and d.del='1' order by a.total "+ consutlSort +" limit "+page * pagesize +","+pagesize;
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         logger.info("findDoctorByHospitalAndDiseaseAndDept end:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
 |