| 
					
				 | 
			
			
				@ -2983,6 +2983,27 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    // 上分辅导  查询全部状态工单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String, Object>> getDoorServiceDictNum(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT DISTINCT" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " COUNT(co.id) AS total," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " co.hospital AS hospital," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " fd.`name` AS dictName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " bo.`name` AS hhospitalName" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " FROM" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " base_door_coach_order co" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " INNER JOIN base_door_coach_fee_detail fd ON co.id = fd.order_id INNER JOIN base_org bo ON co.hospital = bo.code" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " WHERE" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " co.`status` > 0"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " AND bo.`code` NOT IN (SELECT dict_code FROM wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " GROUP BY co.hospital"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return list; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     *  获取生活照料排名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param endDate 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3448,7 +3469,7 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String emeSecOrderListTotalSql(String nameSql,String idcardSql,String orgCodeSql,String statusSql){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT SUM(a.total) FROM(\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "SELECT \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tcount(DISTINCT o.id) AS total \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "count(DISTINCT o.id) AS total \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tbase_emergency_assistance_order o\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tLEFT JOIN base_patient p ON o.patient = p.id\n" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3729,10 +3750,10 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "                INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "                where dev.contact_status=1 and pd.device_type = 0  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //七天使用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //七天使用      AND device_category= 4  手表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sevenDayUseSql ="select count(distinct pd.device_sn) total from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "                INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "                where pd.device_type = "+type+"  AND EXISTS(SELECT 1 FROM device_data_push_log pl WHERE pl.device_sn = pd.device_sn AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= pl.create_time ) AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "                where pd.device_type = "+type+"  AND EXISTS(SELECT 1 FROM device_data_push_log pl WHERE pl.device_sn = pd.device_sn  AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= pl.create_time ) AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Integer> total = jdbcTemplate.queryForList(typeTotalSql, Integer.class); 
			 |