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