| 
					
				 | 
			
			
				@ -7200,13 +7200,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            String diseaseKey, String doctorNameKey, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            String jobTitleNameKey, String outpatientType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            String keyName, String workingTime, String consultStatus, String chargType, String consutlSort, String isAttention, Integer page, Integer pagesize) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      /*  if(page >=1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            page --; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (pagesize <= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pagesize = 10; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        long statr = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.id AS \"id\", " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -7218,16 +7211,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.job_title_name AS \"jobTitleName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.charge_type AS \"chargeType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.dept_name AS \"deptName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " dw.workTotal AS \"workTotal\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.consult_status AS \"consultStatus\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(dw.workTotal,0) AS \"workTotal\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(d.consult_status,0) AS \"consultStatus\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.outpatient_type AS \"outpatientType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " a.total AS \"consultTotal\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " IFNULL(a.total,0) AS \"consultTotal\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.org_name AS \"orgName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.org_code AS \"orgCode\" " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNoneBlank(patientid)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" , follow.id AS \"followid\" " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += ",evaluate.score as \"score\",a.total as \"total\""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += ",IFNULL(evaluate.score,0) as \"score\",IFNULL(a.total,0) as \"total\""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql+=" FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " base_doctor d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -7384,7 +7377,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            "\tD.id DESC,dw.workTotal DESC NULLS LAST"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and d.del='1' "+groupBy+" order by d.consult_status DESC ,evaluate.score desc,a.total " + consutlSort+""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and d.del='1' "+groupBy+" order by workTotal DESC,consultStatus DESC ,score desc," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "total " + consutlSort+",dhd.saas_id, d.job_title_code desc"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |