流量统计新app详情,动作趋势详情统计数接口
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.restful.NtcEntranceReport;
|
||||
import com.nis.domain.restful.dashboard.NtcTotalReport;
|
||||
import com.nis.domain.restful.dashboard.TrafficTransStatistic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@@ -16,4 +17,7 @@ public interface NtcTotalReportDao {
|
||||
List<Map> getTotalReportList(@Param("reportTime") Date reportTime);
|
||||
List<Map> getNetFlowPortInfoNew(@Param("statTime") Date statTime);
|
||||
List<TrafficTransStatistic> getBandwidthTrans(@Param("statTime") Date statTime,@Param("addrType") String addrType,@Param("transType") Integer transType);
|
||||
|
||||
Map getEntranceMaxReportTime();
|
||||
List<NtcEntranceReport> getActionTrans(@Param("reportTime") Date reportTime,@Param("entranceId") Integer entranceId,@Param("serviceSql") String serviceSql);
|
||||
}
|
||||
@@ -38,8 +38,8 @@
|
||||
<!-- 获取近五分钟的带宽根据ip46,协议 tcp,udp变化 -->
|
||||
<select id="getBandwidthTrans" resultMap="BandwidthResultMap">
|
||||
select IFNULL(p.gbps,0) gbps,IFNULL(p.pps,0) pps,IFNULL(p.sumNum,0) linkNum, date_format(a.min5,'%Y-%m-%d %H:%i') time from
|
||||
(select date_sub(#{statTime},interval @mycnt :=@mycnt + 1 MINUTE) min5
|
||||
from (SELECT @mycnt:=-1) m, traffic_trans_statistic limit 12) a
|
||||
(select date_sub(#{statTime},interval @mycnt :=@mycnt + 5 MINUTE) min5
|
||||
from (SELECT @mycnt:=-5) m, traffic_trans_statistic limit 12) a
|
||||
LEFT JOIN (
|
||||
SELECT date_format(stat_time, '%Y-%m-%d %H:%i') timestamp,
|
||||
SUM(link_num)/300 sumNum,
|
||||
@@ -61,4 +61,24 @@
|
||||
ORDER by time
|
||||
</select>
|
||||
|
||||
<!-- 获取报表最近时间 -->
|
||||
<select id="getEntranceMaxReportTime" resultType="java.util.HashMap">
|
||||
SELECT MAX(report_time) reportTime FROM ntc_entrance_report
|
||||
</select>
|
||||
<!-- entrance 1,2 ,动作为阻断,近五分钟数据 -->
|
||||
<select id="getActionTrans" resultType="com.nis.domain.restful.NtcEntranceReport">
|
||||
select IFNULL(p.sumNum,0) sum, date_format(a.min5,'%Y-%m-%d %H:%i') time from
|
||||
(select date_sub(#{reportTime},interval @mycnt :=@mycnt + 5 MINUTE) min5
|
||||
from (SELECT @mycnt:=-5) m, ntc_entrance_report limit 12) a
|
||||
LEFT JOIN (
|
||||
SELECT date_format(report_time, '%Y-%m-%d %H:%i') timestamp, SUM(sum) sumNum FROM ntc_entrance_report
|
||||
WHERE
|
||||
<![CDATA[${serviceSql}]]>
|
||||
and entrance_id=#{entranceId}
|
||||
and report_time > DATE_SUB(#{reportTime}, INTERVAL 1 HOUR)
|
||||
GROUP by timestamp
|
||||
) p
|
||||
on date_format(p.timestamp,'%Y-%m-%d %H:%i')=date_format(a.min5,'%Y-%m-%d %H:%i')
|
||||
ORDER by time
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -13,4 +13,5 @@ public interface TrafficAppStatisticDao {
|
||||
|
||||
TrafficAppStatistic getMaxStatTime();
|
||||
List<Map> appChart(@Param("statTime")Date statTime);
|
||||
List<Map> getAppList(@Param("statTime")Date statTime);
|
||||
}
|
||||
@@ -24,4 +24,12 @@
|
||||
WHERE app_type !=0 and stat_time = #{statTime}
|
||||
GROUP BY app_type order by count desc limit 0,10
|
||||
</select>
|
||||
<!-- 获取app统计详情 -->
|
||||
<select id="getAppList" resultType="java.util.HashMap">
|
||||
SELECT IFNULL(c.app_name,p.app_type) appName,p.app_type appType,p.link_num linkNum, p.packets packets, p.GByte GByte FROM (
|
||||
SELECT app_type,SUM(link_num) AS link_num,SUM(c2s_pkt_num+s2c_pkt_num) AS packets,
|
||||
(SUM(c2s_byte_len+s2c_byte_len)/1024/1024/1024) AS GByte
|
||||
FROM traffic_app_statistic WHERE stat_time=#{statTime} GROUP BY app_type ) p
|
||||
LEFT JOIN ui_code_app_dic c ON p.app_type=c.view_code ORDER BY p.GByte DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -25,7 +25,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getProtocolList" resultType="java.util.HashMap">
|
||||
SELECT c.protocol_type protocolType,p.proto_type protoType,p.link_num linkNum, p.packets packets, p.GByte GByte FROM (
|
||||
SELECT IFNULL(c.protocol_type,p.proto_type) protocolType,p.proto_type protoType,p.link_num linkNum, p.packets packets, p.GByte GByte FROM (
|
||||
SELECT proto_type,SUM(link_num) AS link_num,SUM(c2s_pkt_num+s2c_pkt_num) AS packets,
|
||||
(SUM(c2s_byte_len+s2c_byte_len)/1024/1024/1024) AS GByte
|
||||
FROM traffic_protocol_statistic WHERE stat_time=#{statTime} GROUP BY proto_type ) p
|
||||
|
||||
Reference in New Issue
Block a user