大屏统计图表接口返回值增加上一段时间参数preCount,其它类型others
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
stat_time
|
||||
</sql>
|
||||
<select id="appChart" resultType="java.util.HashMap">
|
||||
SELECT app_type appType, count(app_type) 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 555 HOUR)
|
||||
GROUP BY app_type limit 0,10
|
||||
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>
|
||||
</mapper>
|
||||
@@ -12,4 +12,8 @@ public interface TrafficHttpStatisticDao {
|
||||
List<TrafficHttpStatistic> websiteList();
|
||||
|
||||
List<Map> getTypeBywebsite(@Param("webId") Integer webId);
|
||||
|
||||
Map websiteTypeOthers(@Param("webType") List webType,@Param("webId") Integer webId);
|
||||
|
||||
Integer preWebsiteListCount(@Param("webId") Integer webId);
|
||||
}
|
||||
@@ -17,14 +17,32 @@
|
||||
</sql>
|
||||
<!--获取网站列表列表 -->
|
||||
<select id="websiteList" resultMap="BaseResultMap">
|
||||
SELECT web_id webId, count(web_id) 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 555 HOUR)
|
||||
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="getTypeBywebsite" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
SELECT web_type webType, count(web_type) 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 555 HOUR)
|
||||
GROUP BY web_type limit 0,10
|
||||
<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)
|
||||
</select>
|
||||
<!-- 指定网站下的TOP10之外为others -->
|
||||
<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=",">
|
||||
#{singleType}
|
||||
</foreach>
|
||||
</if>
|
||||
and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -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 555 HOUR)
|
||||
WHERE stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
|
||||
GROUP BY ip_addr ORDER BY link_num DESC limit 0,10
|
||||
</select>
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
stat_time
|
||||
</sql>
|
||||
<select id="protocolChart" resultType="java.util.HashMap">
|
||||
SELECT proto_type protoType, count(proto_type) 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 555 HOUR)
|
||||
GROUP BY proto_type limit 0,10
|
||||
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>
|
||||
</mapper>
|
||||
@@ -17,4 +17,12 @@ public interface TrafficUaStatisticDao {
|
||||
List<TrafficUaStatistic> browserList();
|
||||
|
||||
List<Map> getSystemBybrowser(@Param("bsType") Integer bsType);
|
||||
|
||||
Map systemOthers(@Param("bsType") List bsType,@Param("osType") Integer osType);
|
||||
|
||||
Map browserOthers(@Param("osType") List osType,@Param("bsType") Integer bsType);
|
||||
|
||||
Integer preSystemListCount(@Param("osType") Integer osType);
|
||||
|
||||
Integer preBrowserListCount(@Param("bsType") Integer bsType);
|
||||
}
|
||||
@@ -16,28 +16,65 @@
|
||||
stat_id, bs_type,os_type, entrance_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
||||
stat_time
|
||||
</sql>
|
||||
<!--获取操作系统列表 -->
|
||||
<!--获取操作系统列表TOP10 -->
|
||||
<select id="systemList" resultMap="BaseResultMap">
|
||||
SELECT os_type osType, count(os_type) 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 555 HOUR)
|
||||
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)
|
||||
GROUP BY os_type ORDER BY count DESC limit 0,10
|
||||
</select>
|
||||
<!-- 根据操作系统获取浏览器分类 -->
|
||||
<select id="getBrowserBySystem" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
SELECT bs_type bsType, count(bs_type) 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 555 HOUR)
|
||||
GROUP BY bs_type limit 0,10
|
||||
<!--获取上个时间段操作系统的数据量 -->
|
||||
<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
|
||||
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)
|
||||
</select>
|
||||
<!--获取浏览器列表 -->
|
||||
<select id="browserList" resultMap="BaseResultMap">
|
||||
SELECT bs_type bsType, count(bs_type) 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 555 HOUR)
|
||||
<!-- 根据操作系统获取浏览器分类 -->
|
||||
<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)
|
||||
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
|
||||
WHERE bs_type !=0 and os_type=#{osType}
|
||||
<if test="bsType!=null and bsType.size()>0">
|
||||
and os_type not in
|
||||
<foreach collection="bsType" item="singleType" index="index" open="(" close=")" separator=",">
|
||||
#{singleType}
|
||||
</foreach>
|
||||
</if>
|
||||
and stat_time >= DATE_SUB(NOW(),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)
|
||||
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
|
||||
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)
|
||||
</select>
|
||||
<!-- 根据浏览器获取操作系统分类 -->
|
||||
<select id="getSystemBybrowser" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
SELECT os_type osType, count(os_type) 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 555 HOUR)
|
||||
GROUP BY os_type limit 0,10
|
||||
<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)
|
||||
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
|
||||
WHERE os_type !=0 and bs_type=#{bsType}
|
||||
<if test="osType!=null and osType.size()>0">
|
||||
and bs_type not in
|
||||
<foreach collection="osType" item="singleType" index="index" open="(" close=")" separator=",">
|
||||
#{singleType}
|
||||
</foreach>
|
||||
</if>
|
||||
and stat_time >= DATE_SUB(NOW(),INTERVAL 5 MINUTE)
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user