1:为通联关系查询添加asn的条件
2:修改traffic的查询bug
This commit is contained in:
@@ -21,6 +21,9 @@ public class NtcAsnRecord implements Serializable {
|
||||
private String bps;
|
||||
private String pps;
|
||||
private String asn;
|
||||
|
||||
|
||||
private String searchAsn;
|
||||
private String searchFoundStartTime;// 开始发现时间
|
||||
private String searchFoundEndTime;// 结束发现时间
|
||||
|
||||
@@ -50,6 +53,15 @@ public class NtcAsnRecord implements Serializable {
|
||||
this.asn = asn;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getSearchAsn() {
|
||||
return searchAsn;
|
||||
}
|
||||
|
||||
public void setSearchAsn(String searchAsn) {
|
||||
this.searchAsn = searchAsn;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getSearchAsnType() {
|
||||
return searchAsnType;
|
||||
|
||||
@@ -75,7 +75,8 @@
|
||||
type="com.nis.domain.restful.NtcURLIpReport">
|
||||
<result column="url" jdbcType="VARCHAR" property="url" />
|
||||
<result column="ipCount" jdbcType="BIGINT" property="ipCount" />
|
||||
<result column="connCount" jdbcType="BIGINT" property="connCount" />
|
||||
<result column="connCount" jdbcType="BIGINT"
|
||||
property="connCount" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="NtcRadiusReportMap"
|
||||
@@ -97,7 +98,8 @@
|
||||
property="ipEndNum" />
|
||||
<result column="ip_sub" jdbcType="VARCHAR" property="ipSub" />
|
||||
<result column="country" jdbcType="VARCHAR" property="country" />
|
||||
<result column="area_type" jdbcType="VARCHAR" property="areaType" />
|
||||
<result column="area_type" jdbcType="VARCHAR"
|
||||
property="areaType" />
|
||||
<result column="desc_detail" jdbcType="VARCHAR" property="desc" />
|
||||
</resultMap>
|
||||
|
||||
@@ -759,8 +761,8 @@
|
||||
</otherwise>
|
||||
</choose>
|
||||
FROM (SELECT url,
|
||||
count(distinct ip_addr) ipCount,
|
||||
sum(sum) connCount
|
||||
count(distinct ip_addr) ipCount,
|
||||
sum(sum) connCount
|
||||
FROM ntc_reject_url_statistic
|
||||
|
||||
<where>
|
||||
@@ -777,7 +779,7 @@
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY url
|
||||
) ntc_reject_url_statistic ORDER BY ipcount desc,connCount desc
|
||||
) ntc_reject_url_statistic ORDER BY ipcount desc,connCount desc
|
||||
</select>
|
||||
|
||||
|
||||
@@ -850,7 +852,8 @@
|
||||
<select id="findNtcIpRangeReport"
|
||||
parameterType="com.nis.domain.restful.NtcIpRangeReport"
|
||||
resultMap="NtcIpRangeReportMap">
|
||||
SELECT ip_start,ip_end,ip_start_num,ip_end_num,ip_sub,country,area_type,desc_detail
|
||||
SELECT
|
||||
ip_start,ip_end,ip_start_num,ip_end_num,ip_sub,country,area_type,desc_detail
|
||||
FROM
|
||||
traffic_ip_identify
|
||||
<where>
|
||||
@@ -861,9 +864,9 @@
|
||||
<![CDATA[AND country= #{searchCountry} ]]>
|
||||
</if>
|
||||
<if test="searchIp != null and searchIp !=''">
|
||||
<![CDATA[AND ip_start_num>= #{searchIp} and ip_end_num<=#{searchIp}]]>
|
||||
<![CDATA[AND ip_end_num>=#{searchIp} and ip_start_num<= #{searchIp} ]]>
|
||||
</if>
|
||||
<if test="searchDesc != null and searchDesc !=''">
|
||||
<if test="searchDesc != null and searchDesc !=''">
|
||||
<![CDATA[AND desc_detail= #{searchDesc} ]]>
|
||||
</if>
|
||||
</where>
|
||||
@@ -877,7 +880,8 @@
|
||||
VALUES
|
||||
<foreach collection="list" item="ipRange" separator=",">
|
||||
(#{ipRange.ipStart}, #{ipRange.ipEnd},
|
||||
#{ipRange.ipStartNum}, #{ipRange.ipEndNum},
|
||||
#{ipRange.ipStartNum},
|
||||
#{ipRange.ipEndNum},
|
||||
#{ipRange.ipSub}, #{ipRange.areaType},
|
||||
#{ipRange.country})
|
||||
</foreach>
|
||||
|
||||
@@ -123,7 +123,7 @@ FROM
|
||||
</select>
|
||||
<!--获取域名 -->
|
||||
<select id="getTrafficHttpDomain" resultType="java.util.HashMap">
|
||||
select web_id webId, unique_num uniqueNum,entrance_id entranceId,SUM(c2s_byte_len + s2c_byte_len) byteCount,
|
||||
select web_id webId, max(unique_num) uniqueNum,entrance_id entranceId,SUM(c2s_byte_len + s2c_byte_len) byteCount,
|
||||
sum(c2s_pkt_num + s2c_pkt_num) pktCount from traffic_http_focus_statistic t where
|
||||
<![CDATA[ stat_time>= #{beginDate} and stat_time< #{endDate}]]>
|
||||
<if test="domain!=null">
|
||||
@@ -135,12 +135,14 @@ FROM
|
||||
group by web_id order by unique_num
|
||||
</select>
|
||||
<select id="getDomainTrans" resultType="com.nis.domain.restful.dashboard.TrafficHttpFocusStatistic">
|
||||
select stat_time time, unique_num count from traffic_http_focus_statistic t where
|
||||
select stat_time time, max(unique_num)count from traffic_http_focus_statistic t where
|
||||
<![CDATA[ stat_time>= #{beginDate} and stat_time< #{endDate}]]>
|
||||
and web_id=#{domain}
|
||||
<if test="entranceId!=null">
|
||||
and entrance_id=#{entranceId}
|
||||
</if>
|
||||
|
||||
group by stat_time
|
||||
order by stat_time
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -90,8 +90,7 @@ public class LogDataService {
|
||||
RestBusinessCode.param_formate_error.getValue());
|
||||
}
|
||||
|
||||
|
||||
|
||||
String searchAsn = ntcAsnRecord.getSearchAsn();
|
||||
String asn = "s_asn ";
|
||||
if (ntcAsnRecord.getSearchAsnType().trim().equals("1")) {
|
||||
asn = "d_asn ";
|
||||
@@ -110,16 +109,27 @@ public class LogDataService {
|
||||
sql.append(startTime);
|
||||
sql.append(" and found_time< ");
|
||||
sql.append(endTime);
|
||||
|
||||
if (searchAsn != null && !searchAsn.equals("")) {
|
||||
sql.append(" and " + asn + "='" + searchAsn + "'");
|
||||
}
|
||||
|
||||
StringBuffer countSql = new StringBuffer();
|
||||
countSql.append("select count(1) from (");
|
||||
countSql.append(sql);
|
||||
countSql.append(" ) group by ");
|
||||
countSql.append(asn+")");
|
||||
Integer startNum = (page.getPageNo() - 1) * page.getPageSize();
|
||||
Integer limitCount = startNum + page.getPageSize();
|
||||
|
||||
sql.append(" limit " + limitCount + " ) group by "+asn+" order by bps desc,pps desc limit " + startNum + "," + page.getPageSize());
|
||||
|
||||
countSql.append(" ) ");
|
||||
if (searchAsn != null && !searchAsn.equals("")) {
|
||||
countSql.append(" and " + asn + "='" + searchAsn + "'");
|
||||
}
|
||||
countSql.append("group by ");
|
||||
countSql.append(asn + ")");
|
||||
Integer startNum = 0;
|
||||
Integer limitCount = startNum + 20;
|
||||
sql.append(" limit " + limitCount + " ) ");
|
||||
if (searchAsn != null && !searchAsn.equals("")) {
|
||||
sql.append(" and " + asn + "='" + searchAsn + "'");
|
||||
}
|
||||
sql.append("group by " + asn + " order by bps desc,pps desc limit " + startNum + "," + 20);
|
||||
localLogJDBCByDruid.getCount(page, countSql.toString());
|
||||
|
||||
page.setList(localLogJDBCByDruid.getNtcAsnRecordData(sql.toString()));
|
||||
|
||||
Reference in New Issue
Block a user