| 
					
				 | 
			
			
				@ -118,6 +118,7 @@ import java.math.BigDecimal; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.net.URL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.text.DecimalFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.text.ParseException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4301,7 +4302,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return times; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 医生可接单列表(图文复诊、视频复诊、协同门诊) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4311,7 +4311,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @query_status 0:图文复诊候诊 1:图文复诊抢单列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @dept 部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "room.outpatient_id AS \"id\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4327,6 +4327,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "outpatient.consumer_name as \"consumerName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "outpatient.consumer_mobile as \"consumerMobile\", "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("xm_ykyy_wx".equals(wechatId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            flag =true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4374,6 +4375,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNoneBlank(dept)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND outpatient.dept='" + dept + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNoneBlank(sex)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND patient.sex=" + sex + " "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }if(StringUtils.isNoneBlank(keyword)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND patient.name like '%" + keyword + "%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNoneBlank(ageGroup)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] age = ageGroup.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Calendar nowBegin = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Calendar nowEnd = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            nowBegin.add(Calendar.YEAR,-Integer.parseInt(age[0])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            nowEnd.add(Calendar.YEAR,-Integer.parseInt(age[1])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String beginAge =  sf.format(nowBegin.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String endAge =  sf.format(nowEnd.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if("xm_ykyy_wx".equals(wechatId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql+=" and patient.birthday > '" + endAge + "' and patient.birthday<'" + beginAge + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql+=" and patient.birthday > to_date('" + endAge + "', 'yyyy-mm-dd') and patient.birthday < to_date('" + beginAge + "','yyyy-mm-dd')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql+=" and patient.birthday > '" + endAge + "' and patient.birthday<'" + beginAge + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("接口名称:findWaitingRoomOutpatientByDoctor-->sql="+sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); 
			 |