新增流量统计端口,主题接口

This commit is contained in:
zhanghongqing
2018-09-21 20:56:01 +08:00
parent 6f77f9aa6d
commit 9e59c5f26e
16 changed files with 544 additions and 80 deletions

View File

@@ -0,0 +1,11 @@
package com.nis.web.dao.dashboard;
import java.util.List;
import java.util.Map;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface NtcTotalReportDao {
List<Map> getTotalReportList();
}

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.NtcTotalReportDao">
<!-- <resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.NtcTotalReport">
<id column="stat_id" jdbcType="INTEGER" property="statId" />
<result column="app_type" jdbcType="INTEGER" property="appType" />
<result column="entrance_id" jdbcType="INTEGER" property="entranceId" />
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
<result column="c2s_byte_len" jdbcType="INTEGER" property="c2sByteLen" />
<result column="s2c_byte_len" jdbcType="INTEGER" property="s2cByteLen" />
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
</resultMap> -->
<!-- <select id="appChart" resultType="java.util.HashMap">
SELECT app_type appType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_app_statistic
WHERE app_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
GROUP BY app_type order by count desc limit 0,10
</select> -->
<select id="getTotalReportList" resultType="java.util.HashMap">
SELECT SUM(reject_num) rejectNum,SUM(monitor_num) monitorNum,SUM(c2s_pkt_num) c2sPktNum,SUM(s2c_pkt_num) s2cPktNum,SUM(c2s_byte_len) c2sByteLen,SUM(s2c_byte_len) s2cByteLen,SUM(new_uni_conn_num) newUniConnNum,SUM(live_conn_num) liveConnNum,
SUM(drop_conn_num) dropConnNum,SUM(loop_conn_num) loopConnNum FROM galaxy.ntc_total_report
where report_time >= DATE_SUB((SELECT MAX(report_time) FROM ntc_total_report),INTERVAL 5 MINUTE)
</select>
</mapper>

View File

@@ -16,8 +16,9 @@
stat_time
</sql>
<select id="appChart" resultType="java.util.HashMap">
SELECT app_type appType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_app_statistic
WHERE app_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
SELECT app_type appType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
FROM galaxy.traffic_app_statistic
WHERE app_type !=0 and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_app_statistic),INTERVAL 5 MINUTE)
GROUP BY app_type order by count desc limit 0,10
</select>
</mapper>

View File

@@ -10,10 +10,14 @@ import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface TrafficHttpStatisticDao {
List<TrafficHttpStatistic> websiteList();
List<Map> getTypeBywebsite(@Param("webId") Integer webId);
Map websiteTypeOthers(@Param("webType") List webType,@Param("webId") Integer webId);
//获取域名分类之后属于的网站
List<TrafficHttpStatistic> getDomainByWebsiteList();
Integer preWebsiteListCount(@Param("webId") Integer webId);
List<Map> getDomainByWebsiteServiceId(@Param("websiteServiceId") Integer websiteServiceId);
Map websiteDomainOthers(@Param("webIdList") List webIdList,@Param("websiteServiceId") Integer websiteServiceId);
List<Map> getDomainByTopicList();
List<Map> getDomainByTopicId(@Param("topicId")Object TopicId);
}

View File

@@ -3,7 +3,7 @@
<mapper namespace="com.nis.web.dao.dashboard.TrafficHttpStatisticDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficHttpStatistic">
<id column="stat_id" jdbcType="INTEGER" property="statId" />
<result column="web_type" jdbcType="INTEGER" property="webType" />
<result column="link_num" jdbcType="INTEGER" property="linkNum" />
<result column="web_id" jdbcType="INTEGER" property="webId" />
<result column="c2s_pkt_num" jdbcType="INTEGER" property="c2sPktNum" />
<result column="s2c_pkt_num" jdbcType="INTEGER" property="s2cPktNum" />
@@ -15,34 +15,64 @@
stat_id, web_type, web_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
stat_time
</sql>
<!-- 根据服务网站将域名分类 网站列表-->
<select id="getDomainByWebsiteList" resultType="com.nis.domain.restful.dashboard.TrafficHttpStatistic">
SELECT SUM(link_num) count, IFNULL( website_service_id, 268435455 ) websiteServiceId ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
FROM galaxy.TRAFFIC_HTTP_STATISTIC t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
and stat_time between DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 10 MINUTE) and DATE_SUB(NOW(),INTERVAL 5 MINUTE)
GROUP BY u.website_service_id ORDER BY t.link_num limit 0,10
</select>
<!-- 根据主题将域名分类 主题列表 最近五分钟top10-->
<select id="getDomainByTopicList" resultType="java.util.HashMap">
SELECT SUM(link_num) count, IFNULL( topic_id, 268435455 ) topicId ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
FROM galaxy.TRAFFIC_HTTP_STATISTIC t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 5 MINUTE)
GROUP BY u.topic_id ORDER BY t.link_num limit 0,10
</select>
<!--获取上个时间段该网站站域名流量的数据量 -->
<select id="preWebsiteListCount" resultType="java.lang.Integer">
SELECT SUM(link_num) count FROM galaxy.traffic_http_statistic
WHERE web_id=#{webId}
and stat_time between DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 10 MINUTE) and DATE_SUB(NOW(),INTERVAL 5 MINUTE)
</select>
<select id="websiteList" resultMap="BaseResultMap">
<!--获取网站列表列表 -->
<!-- <select id="websiteList" resultMap="BaseResultMap">
SELECT web_id webId, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_http_statistic
WHERE web_id !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
GROUP BY web_id ORDER BY count DESC limit 0,10
</select> -->
<!-- 根据网站分组获取子域名 -->
<select id="getDomainByWebsiteServiceId" parameterType="java.lang.Integer" resultType="java.util.HashMap">
SELECT web_id webId,link_num count,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
FROM galaxy.traffic_http_statistic t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
where u.website_service_id=#{websiteServiceId}
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 5 MINUTE)
<!-- 根据网站分类 -->
<select id="getTypeBywebsite" parameterType="java.lang.Integer" resultType="java.util.HashMap">
SELECT web_type webType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_http_statistic
WHERE web_type !=0 and web_id=#{webId} and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
GROUP BY web_type ORDER BY count limit 0,10
</select>
<!--获取上个时间段网站流量的数据量 -->
<select id="preWebsiteListCount" resultType="java.lang.Integer">
SELECT (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count FROM galaxy.traffic_http_statistic
WHERE web_type !=0 and web_id=#{webId}
and stat_time between DATE_SUB(NOW(),INTERVAL 10 MINUTE) and DATE_SUB(NOW(),INTERVAL 5 MINUTE)
GROUP BY t.web_id ORDER BY t.link_num limit 0,10
</select>
<!-- 根据主题分组获取子域名 -->
<select id="getDomainByTopicId" resultType="java.util.HashMap">
SELECT web_id webId,link_num count,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
FROM galaxy.traffic_http_statistic t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
where u.topic_id=#{topicId}
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 5 MINUTE)
GROUP BY t.web_id ORDER BY t.link_num limit 0,10
</select>
<select id="websiteTypeOthers" resultType="java.util.HashMap">
SELECT (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_http_statistic
WHERE web_type !=0 and web_id=#{webId}
<if test="webType!=null and webType.size()>0">
and bs_type not in
<foreach collection="webType" item="singleType" index="index" open="(" close=")" separator=",">
<!-- 指定网站下的TOP10之外为others -->
<select id="websiteDomainOthers" resultType="java.util.HashMap">
SELECT SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_http_statistic t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
where u.website_service_id=#{websiteServiceId}
<if test="webIdList!=null and webIdList.size()>0">
and t.web_id not in
<foreach collection="webIdList" item="singleType" index="index" open="(" close=")" separator=",">
#{singleType}
and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
</foreach>
</if>
and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 5 MINUTE)

View File

@@ -26,7 +26,7 @@
<!-- IP流量统计-->
<select id="ipActiveChart" resultType="java.util.LinkedHashMap">
SELECT ip_addr ipAddr, SUM(link_num) linkNum ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ip_active_statistic
WHERE stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
WHERE stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ip_active_statistic),INTERVAL 5 MINUTE)
GROUP BY ip_addr ORDER BY link_num DESC limit 0,10
</select>

View File

@@ -0,0 +1,12 @@
package com.nis.web.dao.dashboard;
import java.util.List;
import java.util.Map;
import com.nis.domain.restful.dashboard.TrafficPortActiveStatistic;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface TrafficPortActiveStatisticDao {
List<TrafficPortActiveStatistic> getPortActiveList();
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.dashboard.TrafficPortActiveStatisticDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficPortActiveStatistic">
<id column="stat_id" jdbcType="INTEGER" property="statId" />
<result column="port" jdbcType="INTEGER" property="port" />
<result column="sum" jdbcType="INTEGER" property="sum" />
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
</resultMap>
<select id="getPortActiveList" resultMap="BaseResultMap">
SELECT port ,SUM(sum) sum from galaxy.traffic_port_active_statistic
WHERE stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_port_active_statistic),INTERVAL 5 MINUTE)
GROUP BY port order by sum limit 0,10
</select>
</mapper>

View File

@@ -16,6 +16,7 @@
stat_time
</sql>
<select id="protocolChart" resultType="java.util.HashMap">
SELECT proto_type protoType, ( SUM(c2s_pkt_num) + SUM(s2c_pkt_num) + SUM(c2s_byte_len) + SUM(s2c_byte_len)) count, ( SUM(c2s_pkt_num) + SUM(s2c_pkt_num)) pktNum, ( SUM(c2s_byte_len) + SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_protocol_statistic WHERE proto_type != 0 AND stat_time >= DATE_SUB(NOW(), INTERVAL 5 MINUTE) GROUP BY proto_type ORDER BY count DESC LIMIT 0, 10
SELECT proto_type protoType, SUM(link_num) count, ( SUM(c2s_pkt_num) + SUM(s2c_pkt_num)) pktNum, ( SUM(c2s_byte_len) + SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_protocol_statistic WHERE proto_type != 0
AND stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_protocol_statistic), INTERVAL 5 MINUTE) GROUP BY proto_type ORDER BY count DESC LIMIT 0, 10
</select>
</mapper>

View File

@@ -18,25 +18,25 @@
</sql>
<!--获取操作系统列表TOP10 -->
<select id="systemList" resultMap="BaseResultMap">
SELECT os_type osType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE os_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
SELECT os_type osType, SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE os_type !=0 and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
GROUP BY os_type ORDER BY count DESC limit 0,10
</select>
<!--获取上个时间段操作系统的数据量 -->
<select id="preSystemListCount" resultType="java.lang.Integer">
SELECT (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count FROM galaxy.traffic_ua_statistic
SELECT SUM(link_num) count FROM galaxy.traffic_ua_statistic
WHERE os_type !=0 and os_type=#{osType}
and stat_time between DATE_SUB(NOW(),INTERVAL 10 MINUTE) and DATE_SUB(NOW(),INTERVAL 5 MINUTE)
and stat_time between DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 10 MINUTE) and DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
</select>
<!-- 根据操作系统获取浏览器分类 -->
<select id="getBrowserBySystem" parameterType="java.lang.Integer" resultType="java.util.HashMap">
SELECT bs_type bsType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE bs_type !=0 and os_type=#{osType} and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
SELECT bs_type bsType, SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE bs_type !=0 and os_type=#{osType} and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
GROUP BY bs_type ORDER BY count DESC limit 0,10
</select>
<!--浏览器TOP10后所有为others -->
<select id="systemOthers" resultType="java.util.HashMap">
SELECT (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
SELECT SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE bs_type !=0 and os_type=#{osType}
<if test="bsType!=null and bsType.size()>0">
and os_type not in
@@ -44,30 +44,30 @@
#{singleType}
</foreach>
</if>
and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
</select>
<!--获取浏览器列表TOP10 -->
<select id="browserList" resultMap="BaseResultMap">
SELECT bs_type bsType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE bs_type !=0 and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
SELECT bs_type bsType, SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE bs_type !=0 and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
GROUP BY bs_type ORDER BY count DESC limit 0,10
</select>
<!--获取上个时间段浏览器的数据量 -->
<select id="preBrowserListCount" resultType="java.lang.Integer">
SELECT (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count FROM galaxy.traffic_ua_statistic
SELECT SUM(link_num) count FROM galaxy.traffic_ua_statistic
WHERE bs_type !=0 and bs_type=#{bsType}
and stat_time between DATE_SUB(NOW(),INTERVAL 10 MINUTE) and DATE_SUB(NOW(),INTERVAL 5 MINUTE)
and stat_time between DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 10 MINUTE) and DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
</select>
<!-- 根据浏览器获取操作系统分类 -->
<select id="getSystemBybrowser" parameterType="java.lang.Integer" resultType="java.util.HashMap">
SELECT os_type osType, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE os_type !=0 and bs_type=#{bsType} and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
SELECT os_type osType, SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE os_type !=0 and bs_type=#{bsType} and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
GROUP BY os_type ORDER BY count DESC limit 0,10
</select>
<!--操作系统TOP10后所有为others -->
<select id="browserOthers" parameterType="java.util.List" resultType="java.util.HashMap">
SELECT (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)+SUM(c2s_byte_len)+SUM(s2c_byte_len)) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
SELECT SUM(link_num) count ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen FROM galaxy.traffic_ua_statistic
WHERE os_type !=0 and bs_type=#{bsType}
<if test="osType!=null and osType.size()>0">
and bs_type not in
@@ -75,6 +75,6 @@
#{singleType}
</foreach>
</if>
and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_ua_statistic),INTERVAL 5 MINUTE)
</select>
</mapper>