From 02ee1ef680db80055ab1bf9c64ae308ee6eaa6b5 Mon Sep 17 00:00:00 2001 From: doufenghu Date: Wed, 16 Jan 2019 16:30:49 +0600 Subject: [PATCH] =?UTF-8?q?fix:=E9=A6=96=E9=A1=B5=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E5=B8=A6=E5=AE=BD=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3=EF=BC=88?= =?UTF-8?q?=E5=8F=96=E6=9C=80=E8=BF=9115=E5=88=86=E9=92=9F=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E6=9C=89=E6=95=B0=E6=8D=AE=EF=BC=89=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AB=AF=E5=8F=A3=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=EF=BC=88=E5=8F=AF=E6=8C=89=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?tcp=E6=88=96udp=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/201901-update.sql | 2 ++ .../com/nis/web/dao/dashboard/NtcTotalReportDao.xml | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 db/201901-update.sql diff --git a/db/201901-update.sql b/db/201901-update.sql new file mode 100644 index 0000000..882c978 --- /dev/null +++ b/db/201901-update.sql @@ -0,0 +1,2 @@ +--活跃端口统计增加传输层协议属性 +alter table traffic_port_active_statistic add trans_proto int(11) default 0 comment '6-tcp 17 -udp'; \ No newline at end of file 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 bf50e8b..2b90249 100644 --- a/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/NtcTotalReportDao.xml @@ -31,15 +31,15 @@ SELECT stat_time statTime FROM traffic_trans_statistic order by stat_time desc limit 1 - + SELECT SUM(total_traffic.inoctets) AS inoctets ,SUM(total_traffic.outoctets) AS outoctets FROM ( SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic - where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=1 ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=1 + where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=1 and stat_time > DATE_SUB(now(), INTERVAL 15 MINUTE) ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=1 UNION ALL SELECT IFNULL(SUM(c2s_byte_len),0) inoctets ,IFNULL(SUM(s2c_byte_len),0) outoctets FROM traffic_trans_statistic - where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=2 ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=2 - ) total_traffic - + where stat_time = (SELECT stat_time FROM traffic_trans_statistic WHERE entrance_id=2 and stat_time > DATE_SUB(now(), INTERVAL 15 MINUTE) ORDER BY stat_time DESC LIMIT 0,1) and entrance_id=2 + ) total_traffic +