Merge branch 'Release-1.2' into develop

This commit is contained in:
doufenghu
2018-10-22 18:01:45 +08:00
7 changed files with 29 additions and 29 deletions

View File

@@ -19,15 +19,15 @@
<select id="getTotalReportList" resultType="java.util.HashMap"> <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, 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 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 galaxy.ntc_total_report),INTERVAL 5 MINUTE) where report_time = (SELECT MAX(report_time) FROM galaxy.ntc_total_report)
</select> </select>
<select id="getNetFlowPortInfoNew" resultType="java.util.HashMap"> <select id="getNetFlowPortInfoNew" resultType="java.util.HashMap">
SELECT SUM(INOCTETS) inoctets ,SUM(OUTOCTETS) outoctets FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO SELECT SUM(INOCTETS) inoctets ,SUM(OUTOCTETS) outoctets FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO
where RECV_TIME >= DATE_SUB((SELECT MAX(RECV_TIME) FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO),INTERVAL 4 MINUTE) where RECV_TIME = (SELECT MAX(RECV_TIME) FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO)
</select> </select>
<!-- 获取上个时间段的数据 -->
<select id="getNetFlowPortInfoOld" resultType="java.util.HashMap"> <select id="getNetFlowPortInfoOld" resultType="java.util.HashMap">
SELECT SUM(INOCTETS) inoctets ,SUM(OUTOCTETS) outoctets FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO SELECT SUM(INOCTETS) inoctets ,SUM(OUTOCTETS) outoctets FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO
where RECV_TIME between DATE_SUB((SELECT MAX(RECV_TIME) FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO),INTERVAL 9 MINUTE) where RECV_TIME = DATE_SUB((SELECT MAX(RECV_TIME) FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO),INTERVAL 5 MINUTE)
and DATE_SUB((SELECT MAX(RECV_TIME) FROM galaxy.TRAFFIC_NETFLOW_PORT_INFO),INTERVAL 4 MINUTE)
</select> </select>
</mapper> </mapper>

View File

@@ -18,7 +18,7 @@
<select id="appChart" resultType="java.util.HashMap"> <select id="appChart" resultType="java.util.HashMap">
SELECT app_type appType, SUM(link_num) count, (SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen SELECT app_type appType, 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_app_statistic FROM galaxy.traffic_app_statistic
WHERE app_type !=0 and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_app_statistic WHERE app_type != 0),INTERVAL 5 MINUTE) WHERE app_type !=0 and stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_app_statistic WHERE app_type != 0)
GROUP BY app_type order by count desc limit 0,10 GROUP BY app_type order by count desc limit 0,10
</select> </select>
</mapper> </mapper>

View File

@@ -19,17 +19,17 @@
<select id="getDomainByWebsiteList" resultType="com.nis.domain.restful.dashboard.TrafficHttpStatistic"> <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 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 FROM galaxy.TRAFFIC_HTTP_STATISTIC t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
and t.web_id!=0 where t.web_id!=0
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE) and t.stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0)
GROUP BY u.website_service_id ORDER BY count desc limit 0,10 GROUP BY u.website_service_id ORDER BY count desc limit 0,10
</select> </select>
<!-- 根据主题将域名分类 主题列表 最近五分钟top10--> <!-- 根据主题将域名分类 主题列表 最近五分钟top10-->
<select id="getDomainByTopicList" resultType="java.util.HashMap"> <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 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 FROM galaxy.TRAFFIC_HTTP_STATISTIC t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
and t.web_id!=0 where t.web_id!=0
and t.stat_time =(SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0) and t.stat_time =(SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0)
GROUP BY u.topic_id ORDER BY count desc limit 0,10 GROUP BY u.topic_id ORDER BY count desc limit 0,10
@@ -37,7 +37,7 @@
<!--获取上个时间段该网站站域名流量的数据量 --> <!--获取上个时间段该网站站域名流量的数据量 -->
<select id="preWebsiteListCount" resultType="java.lang.Integer"> <select id="preWebsiteListCount" resultType="java.lang.Integer">
SELECT SUM(link_num) count FROM galaxy.traffic_http_statistic t SELECT SUM(link_num) count FROM galaxy.traffic_http_statistic t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
WHERE u.website_service_id=#{websiteServiceId} WHERE u.website_service_id=#{websiteServiceId}
and stat_time = DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE) and stat_time = DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE)
</select> </select>
@@ -52,8 +52,8 @@
<select id="getDomainByWebsiteServiceId" parameterType="java.lang.Integer" resultType="java.util.HashMap"> <select id="getDomainByWebsiteServiceId" parameterType="java.lang.Integer" resultType="java.util.HashMap">
SELECT web_id webId,SUM(link_num) count,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen SELECT web_id webId,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 FROM galaxy.traffic_http_statistic t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
where u.website_service_id=#{websiteServiceId} where u.website_service_id=#{websiteServiceId}
and t.stat_time =(SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0) and t.stat_time =(SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0)
GROUP BY t.web_id ORDER BY count desc limit 0,10 GROUP BY t.web_id ORDER BY count desc limit 0,10
</select> </select>
@@ -61,8 +61,8 @@
<select id="getDomainByTopicId" resultType="java.util.HashMap"> <select id="getDomainByTopicId" resultType="java.util.HashMap">
SELECT web_id webId,SUM(link_num) count,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen SELECT web_id webId,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 FROM galaxy.traffic_http_statistic t
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
where u.topic_id=#{topicId} where u.topic_id=#{topicId}
and t.stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0) and t.stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0)
GROUP BY t.web_id ORDER BY count desc limit 0,10 GROUP BY t.web_id ORDER BY count desc limit 0,10
</select> </select>
@@ -77,6 +77,6 @@
and t.web_id not in and t.web_id not in
<foreach collection="webIdList" item="singleType" index="index" open="(" close=")" separator=","> <foreach collection="webIdList" item="singleType" index="index" open="(" close=")" separator=",">
#{singleType} #{singleType}
</foreach> </foreach>
</if> </if>
and stat_time =(SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0) and stat_time =(SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0)

View File

@@ -47,7 +47,7 @@
<!-- IP流量统计五分钟--> <!-- IP流量统计五分钟-->
<select id="ipActiveChart" resultType="java.util.LinkedHashMap"> <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 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((SELECT MAX(stat_time) FROM galaxy.traffic_ip_active_statistic),INTERVAL 5 MINUTE) WHERE stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_ip_active_statistic)
GROUP BY ip_addr ORDER BY linkNum DESC limit 0,10 GROUP BY ip_addr ORDER BY linkNum DESC limit 0,10
</select> </select>

View File

@@ -10,7 +10,7 @@
<select id="getPortActiveList" resultMap="BaseResultMap"> <select id="getPortActiveList" resultMap="BaseResultMap">
SELECT port ,SUM(sum) sum from galaxy.traffic_port_active_statistic 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) WHERE stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_port_active_statistic)
GROUP BY port order by sum limit 0,10 GROUP BY port order by sum desc limit 0,10
</select> </select>
</mapper> </mapper>

View File

@@ -17,6 +17,6 @@
</sql> </sql>
<select id="protocolChart" resultType="java.util.HashMap"> <select id="protocolChart" resultType="java.util.HashMap">
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 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 WHERE proto_type != 0), INTERVAL 5 MINUTE) GROUP BY proto_type ORDER BY count DESC LIMIT 0, 10 AND stat_time = (SELECT MAX(stat_time) FROM galaxy.traffic_protocol_statistic WHERE proto_type != 0) GROUP BY proto_type ORDER BY count DESC LIMIT 0, 10
</select> </select>
</mapper> </mapper>

View File

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