1:为实时统计配置中jediscluster改为每次使用都获取一个新的

2:添加根据配置id获取编译,组,域等信息的接口
3:修改获取或释放redis分布式锁后,将redis连接释放
4:解决冲突
This commit is contained in:
renkaige
2018-12-09 17:30:24 +06:00
parent 09c5a06947
commit ef35100af5
19 changed files with 303 additions and 128 deletions

View File

@@ -17,19 +17,28 @@
</sql>
<!-- 查询最近时间 -->
<select id="getMaxStatTime" resultType="com.nis.domain.restful.dashboard.TrafficAppStatistic">
SELECT MAX(stat_time) statTime FROM traffic_app_statistic WHERE app_type != 0
SELECT stat_time statTime FROM traffic_app_statistic order by stat_time desc limit 1
</select>
<select id="appChart" resultType="java.util.HashMap">
<select id="appChart" resultType="java.util.HashMap">
SELECT app_type appType, SUM(c2s_byte_len+s2c_byte_len) count FROM traffic_app_statistic
WHERE app_type !=0 and stat_time = #{statTime}
WHERE stat_time > DATE_SUB(#{statTime},INTERVAL 1 hour)
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
FROM traffic_app_statistic WHERE
<if test="beginTime==null or endTime==null">
stat_time > DATE_SUB(#{statTime},INTERVAL 1 HOUR)
</if>
<if test="beginTime!=null and endTime!=null">
stat_time >= #{beginTime} and stat_time &lt;= #{endTime}
</if>
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>