43 lines
2.8 KiB
XML
43 lines
2.8 KiB
XML
<?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.TrafficUaStatisticDao">
|
|
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficUaStatistic">
|
|
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
|
<result column="bs_type" jdbcType="INTEGER" property="bsType" />
|
|
<result column="os_type" jdbcType="INTEGER" property="osType" />
|
|
<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>
|
|
<sql id="Base_Column_List">
|
|
stat_id, bs_type,os_type, entrance_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
|
|
stat_time
|
|
</sql>
|
|
<!--获取操作系统列表 -->
|
|
<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)
|
|
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>
|
|
<!--获取浏览器列表 -->
|
|
<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)
|
|
GROUP BY bs_type ORDER BY count DESC limit 0,10
|
|
</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>
|
|
</mapper> |