This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-argus-service/src/main/java/com/nis/web/dao/dashboard/TrafficProtocolStatisticDao.xml

26 lines
1.6 KiB
XML
Raw Normal View History

2018-07-13 19:39:04 +08:00
<?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.TrafficProtocolStatisticDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.dashboard.TrafficProtocolStatistic">
<id column="stat_id" jdbcType="INTEGER" property="statId" />
<result column="proto_type" jdbcType="INTEGER" property="protoType" />
<result column="entrance_id" jdbcType="INTEGER" property="entranceId" />
<result column="c2s_pkt_num" jdbcType="BIGINT" property="c2sPktNum" />
<result column="s2c_pkt_num" jdbcType="BIGINT" property="s2cPktNum" />
<result column="c2s_byte_len" jdbcType="BIGINT" property="c2sByteLen" />
<result column="s2c_byte_len" jdbcType="BIGINT" property="s2cByteLen" />
2018-07-13 19:39:04 +08:00
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
</resultMap>
<sql id="Base_Column_List">
stat_id, proto_type, entrance_id, c2s_pkt_num, s2c_pkt_num, c2s_byte_len, s2c_byte_len,
stat_time
</sql>
2018-10-26 14:41:27 +08:00
<!-- 获取最近时间 -->
<select id="getMaxStatTime" resultType="com.nis.domain.restful.dashboard.TrafficProtocolStatistic">
2018-11-15 17:27:35 +08:00
SELECT MAX(stat_time) statTime FROM traffic_protocol_statistic WHERE proto_type != 0
2018-10-26 14:41:27 +08:00
</select>
2018-07-13 19:39:04 +08:00
<select id="protocolChart" resultType="java.util.HashMap">
2018-11-15 17:27:35 +08:00
SELECT proto_type protoType, SUM(link_num) count FROM traffic_protocol_statistic WHERE proto_type != 0
2018-10-26 14:41:27 +08:00
AND stat_time = #{statTime} GROUP BY proto_type ORDER BY count DESC LIMIT 0, 10
2018-07-13 19:39:04 +08:00
</select>
</mapper>