From 8e8b519167a1886c1e5dbb6f22d26ba649b32192 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sat, 1 Dec 2018 14:10:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?app=20,http=E7=BD=91=E7=AB=99=EF=BC=8C?= =?UTF-8?q?=E6=B4=BB=E8=B7=83IP=EF=BC=8C=E5=8D=8F=E8=AE=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=EF=BC=8Cua=E6=B5=8F=E8=A7=88=E5=99=A8=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E7=B3=BB=E7=BB=9F=20=E6=94=B9=E4=B8=BAbytes=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/dao/dashboard/TrafficAppStatisticDao.xml | 2 +- .../dao/dashboard/TrafficHttpStatisticDao.xml | 12 ++++++------ .../dashboard/TrafficIpActiveStatisticDao.xml | 2 +- .../dashboard/TrafficProtocolStatisticDao.xml | 2 +- .../web/dao/dashboard/TrafficUaStatisticDao.xml | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml index 16f87af..f723bf4 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficAppStatisticDao.xml @@ -20,7 +20,7 @@ SELECT MAX(stat_time) statTime FROM traffic_app_statistic WHERE app_type != 0 diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.xml index 5efa0cf..650768e 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.xml @@ -20,7 +20,7 @@ SELECT MAX(stat_time) statTime FROM traffic_http_statistic WHERE web_id != 0 --> - SELECT SUM(link_num) count FROM traffic_http_statistic t + SELECT SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_http_statistic t LEFT JOIN ui_website_domain_topic u ON t.web_id=u.id where u.website_service_id=#{websiteServiceId} and t.web_id!=0 diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml index 89baf4d..0989949 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficIpActiveStatisticDao.xml @@ -28,7 +28,7 @@ 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 2018481..2a90c0f 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml @@ -20,7 +20,7 @@ SELECT MAX(stat_time) statTime FROM traffic_protocol_statistic WHERE proto_type != 0 \ 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 baf3f6e..b53c9fd 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml @@ -22,25 +22,25 @@ - SELECT bs_type bsType, SUM(link_num) count FROM traffic_ua_statistic + SELECT bs_type bsType, SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_ua_statistic WHERE bs_type !=0 and stat_time = #{statTime} GROUP BY bs_type ORDER BY count DESC limit 0,10 - SELECT SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_http_statistic t LEFT JOIN ui_website_domain_topic u ON t.web_id = u.id WHERE u.website_service_id=#{websiteServiceId} 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 b53c9fd..2f16fdf 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.xml @@ -27,7 +27,7 @@ GROUP BY os_type ORDER BY count DESC limit 0,10 - SELECT SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_ua_statistic WHERE os_type !=0 and os_type=#{osType} and stat_time = DATE_SUB(#{statTime},INTERVAL 5 MINUTE) @@ -58,7 +58,7 @@ GROUP BY bs_type ORDER BY count DESC limit 0,10 - SELECT SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_ua_statistic WHERE bs_type !=0 and bs_type=#{bsType} and stat_time = DATE_SUB(#{statTime},INTERVAL 5 MINUTE) From 5221c2cbad20d584610de743311fc75b896be893 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Sat, 1 Dec 2018 16:45:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=B8=AD=E4=B8=8A=E6=AE=B5=E6=97=B6=E9=97=B4?= =?UTF-8?q?countInteger=E7=B1=BB=E5=9E=8B=E6=94=B9=E4=B8=BALong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/dao/dashboard/TrafficHttpStatisticDao.java | 2 +- .../com/nis/web/dao/dashboard/TrafficUaStatisticDao.java | 4 ++-- .../com/nis/web/service/restful/DashboardService.java | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.java b/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.java index e7ba1f0..85386e1 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.java +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficHttpStatisticDao.java @@ -15,7 +15,7 @@ public interface TrafficHttpStatisticDao { //获取域名分类之后属于的网站 List getDomainByWebsiteList(@Param("statTime")Date statTime); - Integer preWebsiteListCount(@Param("websiteServiceId") Integer websiteServiceId,@Param("statTime") Date statTime); + Long preWebsiteListCount(@Param("websiteServiceId") Integer websiteServiceId,@Param("statTime") Date statTime); List getDomainByWebsiteServiceId(@Param("websiteServiceId") Integer websiteServiceId,@Param("statTime") Date statTime); Map websiteDomainOthers(@Param("webIdList") List webIdList,@Param("websiteServiceId") Integer websiteServiceId,@Param("statTime") Date statTime); diff --git a/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.java b/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.java index de313c1..7e98c8a 100644 --- a/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.java +++ b/src/main/java/com/nis/web/dao/dashboard/TrafficUaStatisticDao.java @@ -25,7 +25,7 @@ public interface TrafficUaStatisticDao { Map browserOthers(@Param("osType") List osType,@Param("bsType") Integer bsType,@Param("statTime") Date statTime); - Integer preSystemListCount(@Param("osType") Integer osType,@Param("statTime") Date statTime); + Long preSystemListCount(@Param("osType") Integer osType,@Param("statTime") Date statTime); - Integer preBrowserListCount(@Param("bsType") Integer bsType,@Param("statTime") Date statTime); + Long preBrowserListCount(@Param("bsType") Integer bsType,@Param("statTime") Date statTime); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/restful/DashboardService.java b/src/main/java/com/nis/web/service/restful/DashboardService.java index e0071a1..408f078 100644 --- a/src/main/java/com/nis/web/service/restful/DashboardService.java +++ b/src/main/java/com/nis/web/service/restful/DashboardService.java @@ -223,7 +223,7 @@ public class DashboardService extends BaseService{ if(maxStatTime!=null) { Date statTime = maxStatTime.getStatTime(); List list = trafficUaStatisticDao.systemList(statTime); - Integer preCount=0; + Long preCount=0l; for (TrafficUaStatistic ua : list) { Map map = new HashMap(); map.put("osType",ua.getOsType()); @@ -272,7 +272,7 @@ public class DashboardService extends BaseService{ if(maxStatTime!=null) { Date statTime = maxStatTime.getStatTime(); List list = trafficUaStatisticDao.browserList(statTime); - Integer preCount=0; + Long preCount=0l; if(list!=null&&list.size()>0){ for (TrafficUaStatistic ua : list) { Map map = new HashMap(); @@ -321,7 +321,7 @@ public class DashboardService extends BaseService{ TrafficHttpStatistic maxStatTime = trafficHttpStatisticDao.getMaxStatTime(); if(maxStatTime!=null) { List list = trafficHttpStatisticDao.websiteList(maxStatTime.getStatTime()); - Integer preCount=0; + Long preCount=0l; if(list!=null&&list.size()>0){ for (TrafficHttpStatistic website : list) { Map map = new HashMap(); @@ -383,7 +383,7 @@ public class DashboardService extends BaseService{ Date statTime = maxStatTime.getStatTime(); List websiteList = trafficHttpStatisticDao.getDomainByWebsiteList(statTime); if(websiteList!=null&&websiteList.size()>0){ - Integer preCount=0; + Long preCount=0l; for (TrafficHttpStatistic website : websiteList) { Map map = new HashMap(); map.put("websiteServiceId",website.getWesiteServiceId());