From 27eb0cd6f0766b2fde41fa339760edc8b30ea950 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sun, 9 Dec 2018 19:13:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1sql?= =?UTF-8?q?=E5=8E=BB=E6=8E=89entrance=5Fid=20=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/dao/dashboard/NtcTotalReportDao.xml | 13 +- .../dao/dashboard/TrafficAppStatisticDao.xml | 55 +++----- .../dashboard/TrafficProtocolStatisticDao.xml | 51 ++----- .../dao/dashboard/TrafficUaStatisticDao.xml | 124 ++++-------------- 4 files changed, 63 insertions(+), 180 deletions(-) diff --git a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml index b14f5b0..f5fd6fe 100644 --- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml @@ -23,7 +23,7 @@ @@ -32,15 +32,8 @@ - SELECT stat_time statTime FROM traffic_app_statistic WHERE app_type != 0 order by stat_time desc limit 1 + SELECT stat_time statTime FROM traffic_app_statistic order by stat_time desc limit 1 - + SELECT app_type appType, SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_app_statistic + WHERE stat_time > DATE_SUB(#{statTime},INTERVAL 1 hour) + GROUP BY app_type order by count desc limit 0,10 + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml index f822300..2d27d3a 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml @@ -19,46 +19,23 @@ - + SELECT proto_type protoType, SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_protocol_statistic WHERE + stat_time > DATE_SUB(#{statTime},INTERVAL 1 hour) GROUP BY proto_type ORDER BY count DESC LIMIT 0, 10 \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml index 0bcc9f8..6d37544 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml @@ -21,132 +21,64 @@ SELECT stat_time statTime FROM traffic_ua_statistic order by stat_time desc limit 1 - + SELECT os_type osType, SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_ua_statistic + WHERE stat_time > DATE_SUB(#{statTime}, INTERVAL 1 HOUR) + GROUP BY os_type ORDER BY count DESC limit 0,10 - - + SELECT os_type osType, SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_ua_statistic + WHERE bs_type=#{bsType} and stat_time > DATE_SUB(#{statTime},INTERVAL 1 HOUR) + GROUP BY os_type ORDER BY count DESC limit 0,10 \ No newline at end of file