|  | @ -2576,43 +2576,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |      * @param doctor
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject doctorIndexConsultCount(String doctor) {
 | 
	
		
			
				|  |  |     public Long doctorIndexConsultCount(String doctor) {
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         //医生问诊量
 | 
	
		
			
				|  |  |         List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctor(doctor);
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         Integer imgCount = 0;
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         Integer videoCount = 0;
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         for(WlyyOutpatientDO wlyyOutpatientDO:wlyyOutpatientDOs){
 | 
	
		
			
				|  |  |             //1.图文 2.视频
 | 
	
		
			
				|  |  |             if("1".equals(wlyyOutpatientDO.getType())){
 | 
	
		
			
				|  |  |                 imgCount ++;
 | 
	
		
			
				|  |  |             }else if("2".equals(wlyyOutpatientDO.getType())){
 | 
	
		
			
				|  |  |                 videoCount ++;
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 continue;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         String totalSql = "SELECT count(a.id) AS total " +
 | 
	
		
			
				|  |  |                 "FROM wlyy_consult a,wlyy_consult_team b " +
 | 
	
		
			
				|  |  |                 "WHERE a.id=b.consult AND b.doctor='"+doctor+"' AND a.type=1 AND b.`status`=0";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
 | 
	
		
			
				|  |  |         String sql ="SELECT " +
 | 
	
		
			
				|  |  |                 "count(room.outpatient_id) AS total " +
 | 
	
		
			
				|  |  |                 "FROM " +
 | 
	
		
			
				|  |  |                 "wlyy_hospital_waiting_room room," +
 | 
	
		
			
				|  |  |                 "base_patient patient," +
 | 
	
		
			
				|  |  |                 "wlyy_outpatient outpatient, " +
 | 
	
		
			
				|  |  |                 "wlyy_consult_team consult " +
 | 
	
		
			
				|  |  |                 "WHERE " +
 | 
	
		
			
				|  |  |                 "room.patient_id=patient.id " +
 | 
	
		
			
				|  |  |                 "AND room.outpatient_id=outpatient.id " +
 | 
	
		
			
				|  |  |                 "AND consult.relation_code=outpatient.id " +
 | 
	
		
			
				|  |  |                 "AND consult.status = 0 " +
 | 
	
		
			
				|  |  |                 "AND room.doctor='"+doctor+"' " +
 | 
	
		
			
				|  |  |                 "AND room.consult_type= 2";
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         Long zjCount = 0L;
 | 
	
		
			
				|  |  |         Long videoOnlineCount = 0l;
 | 
	
		
			
				|  |  |         if (rstotal != null && rstotal.size() > 0) {
 | 
	
		
			
				|  |  |             zjCount = (Long) rstotal.get(0).get("total");
 | 
	
		
			
				|  |  |             videoOnlineCount = (Long) rstotal.get(0).get("total");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  |         result.put("imgCount",imgCount);
 | 
	
		
			
				|  |  |         result.put("videoCount",videoCount);
 | 
	
		
			
				|  |  |         result.put("zjCount",zjCount);
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         return videoOnlineCount;
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     
 | 
	
	
		
			
				|  | @ -2681,4 +2670,34 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取候诊居民数量
 | 
	
		
			
				|  |  |      * @param doctor
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public Long getWaitVideoCount(String doctor) {
 | 
	
		
			
				|  |  |         String sql ="SELECT " +
 | 
	
		
			
				|  |  |                 "count(room.outpatient_id) AS total " +
 | 
	
		
			
				|  |  |                 "FROM " +
 | 
	
		
			
				|  |  |                 "wlyy_hospital_waiting_room room," +
 | 
	
		
			
				|  |  |                 "base_patient patient," +
 | 
	
		
			
				|  |  |                 "wlyy_outpatient outpatient " +
 | 
	
		
			
				|  |  |                 "WHERE " +
 | 
	
		
			
				|  |  |                 "room.patient_id=patient.id " +
 | 
	
		
			
				|  |  |                 "AND room.outpatient_id=outpatient.id " +
 | 
	
		
			
				|  |  |                 "AND outpatient.status = 0 " +
 | 
	
		
			
				|  |  |                 "AND room.doctor='"+doctor+"' " +
 | 
	
		
			
				|  |  |                 "AND room.reservation_time is not null " +
 | 
	
		
			
				|  |  |                 "AND room.consult_type= 2 ";
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         Long waitVideoCount = 0l;
 | 
	
		
			
				|  |  |         if (rstotal != null && rstotal.size() > 0) {
 | 
	
		
			
				|  |  |             waitVideoCount = (Long) rstotal.get(0).get("total");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |         return waitVideoCount;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |