修改流量统计sql更改字段类型与数据库统一
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
<id column="stat_id" jdbcType="INTEGER" property="statId" />
|
||||
<result column="link_num" jdbcType="INTEGER" property="linkNum" />
|
||||
<result column="web_id" jdbcType="INTEGER" property="webId" />
|
||||
<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="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" />
|
||||
<result column="stat_time" jdbcType="TIMESTAMP" property="statTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
@@ -20,7 +20,7 @@
|
||||
SELECT SUM(link_num) count, IFNULL( website_service_id, 268435455 ) websiteServiceId ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
|
||||
FROM galaxy.TRAFFIC_HTTP_STATISTIC t
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
|
||||
and t.web_id!=0
|
||||
and t.web_id!=0
|
||||
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE)
|
||||
GROUP BY u.website_service_id ORDER BY count limit 0,10
|
||||
</select>
|
||||
@@ -28,7 +28,7 @@
|
||||
<select id="getDomainByTopicList" resultType="java.util.HashMap">
|
||||
SELECT SUM(link_num) count, IFNULL( topic_id, 268435455 ) topicId ,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
|
||||
FROM galaxy.TRAFFIC_HTTP_STATISTIC t
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
|
||||
and t.web_id!=0
|
||||
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE)
|
||||
GROUP BY u.topic_id ORDER BY count limit 0,10
|
||||
@@ -37,7 +37,7 @@
|
||||
<!--获取上个时间段该网站站域名流量的数据量 -->
|
||||
<select id="preWebsiteListCount" resultType="java.lang.Integer">
|
||||
SELECT SUM(link_num) count FROM galaxy.traffic_http_statistic t
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id = u.id
|
||||
WHERE u.website_service_id=#{websiteServiceId}
|
||||
and stat_time between DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 10 MINUTE) and DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic),INTERVAL 5 MINUTE)
|
||||
</select>
|
||||
@@ -52,7 +52,7 @@
|
||||
<select id="getDomainByWebsiteServiceId" parameterType="java.lang.Integer" resultType="java.util.HashMap">
|
||||
SELECT web_id webId,SUM(link_num) count,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
|
||||
FROM galaxy.traffic_http_statistic t
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
|
||||
where u.website_service_id=#{websiteServiceId}
|
||||
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE)
|
||||
GROUP BY t.web_id ORDER BY count limit 0,10
|
||||
@@ -61,7 +61,7 @@
|
||||
<select id="getDomainByTopicId" resultType="java.util.HashMap">
|
||||
SELECT web_id webId,SUM(link_num) count,(SUM(c2s_pkt_num)+SUM(s2c_pkt_num)) pktNum,(SUM(c2s_byte_len)+SUM(s2c_byte_len)) byteLen
|
||||
FROM galaxy.traffic_http_statistic t
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
|
||||
LEFT JOIN galaxy.ui_website_domain_topic u ON t.web_id=u.id
|
||||
where u.topic_id=#{topicId}
|
||||
and t.stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE)
|
||||
GROUP BY t.web_id ORDER BY count limit 0,10
|
||||
@@ -77,6 +77,6 @@
|
||||
and t.web_id not in
|
||||
<foreach collection="webIdList" item="singleType" index="index" open="(" close=")" separator=",">
|
||||
#{singleType}
|
||||
</foreach>
|
||||
</foreach>
|
||||
</if>
|
||||
and stat_time >= DATE_SUB((SELECT MAX(stat_time) FROM galaxy.traffic_http_statistic WHERE web_id != 0),INTERVAL 5 MINUTE)
|
||||
Reference in New Issue
Block a user