1:解决冲突

This commit is contained in:
renkaige
2018-12-24 22:31:42 +06:00
8 changed files with 10 additions and 8 deletions

View File

@@ -88,7 +88,7 @@ public class TrafficeReportController extends BaseRestController {
} }
} }
return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "用户行为统计查询成功", page, 0); return serviceLogResponse(saveLogThread, System.currentTimeMillis() - start, request, "用户行为统计查询成功", page.getList(), 0);
} }
/** /**

View File

@@ -170,11 +170,11 @@
</if> </if>
<if <if
test="searchReportStartTime != null and searchReportStartTime !=''"> test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME > STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]> <![CDATA[AND REPORT_TIME >= STR_TO_DATE(#{searchReportStartTime},'%Y-%m-%d %H:%i:%s')]]>
</if> </if>
<if <if
test="searchReportEndTime != null and searchReportEndTime !=''"> test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME <= STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]> <![CDATA[AND REPORT_TIME < STR_TO_DATE(#{searchReportEndTime},'%Y-%m-%d %H:%i:%s')]]>
</if> </if>
</where> </where>
<choose> <choose>

View File

@@ -129,7 +129,7 @@
<!-- entrance 1,2 ,动作为阻断,近一小时 间隔5分钟数据 --> <!-- entrance 1,2 ,动作为阻断,近一小时 间隔5分钟数据 -->
<select id="getActionTrans" resultType="com.nis.domain.restful.NtcEntranceReport"> <select id="getActionTrans" resultType="com.nis.domain.restful.NtcEntranceReport">
select sum(sum) sum,report_time reportTime from ntc_entrance_report r where select sum(sum) sum,report_time reportTime from ntc_entrance_report r where
<![CDATA[${serviceSql} and report_time<=#{endDate} and report_time>=#{beginDate}]]> <![CDATA[${serviceSql} and report_time<#{endDate} and report_time>=#{beginDate}]]>
and entrance_id=#{entranceId} and entrance_id=#{entranceId}
group by report_time order by report_time group by report_time order by report_time
</select> </select>

View File

@@ -32,7 +32,7 @@
SELECT app_type,SUM(link_num) AS link_num,SUM(c2s_pkt_num+s2c_pkt_num) AS packets, 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)*8)/300/1024/1024/1024) AS GByte ((SUM(c2s_byte_len+s2c_byte_len)*8)/300/1024/1024/1024) AS GByte
FROM traffic_app_statistic WHERE FROM traffic_app_statistic WHERE
<![CDATA[ stat_time>= #{beginTime} and stat_time<= #{endTime}]]> <![CDATA[ stat_time>= #{beginTime} and stat_time< #{endTime}]]>
<if test="appType!=null"> <if test="appType!=null">
and app_type in and app_type in
<foreach collection="appType" index="index" item="item" open="(" separator="," close=")"> <foreach collection="appType" index="index" item="item" open="(" separator="," close=")">

View File

@@ -125,7 +125,7 @@ FROM
<select id="getTrafficHttpDomain" resultType="java.util.HashMap"> <select id="getTrafficHttpDomain" resultType="java.util.HashMap">
select web_id webId, max(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">
and web_id in and web_id in
<foreach collection="domain" index="index" item="item" open="(" separator="," close=")"> <foreach collection="domain" index="index" item="item" open="(" separator="," close=")">

View File

@@ -71,7 +71,7 @@
<select id="ipActiveOneHour" resultType="java.util.HashMap"> <select id="ipActiveOneHour" resultType="java.util.HashMap">
SELECT ip_addr ipAddr,area_id areaId,SUM(c2s_byte_len+s2c_byte_len) count, link_num linkNum ,c2s_pkt_num c2sPktNum,s2c_pkt_num s2cPktNum,c2s_byte_len c2sByteLen,s2c_byte_len s2cByteLen,date_format(stat_time, '%Y-%m-%d %H:%i:%s') statTime FROM traffic_ip_active_statistic SELECT ip_addr ipAddr,area_id areaId,SUM(c2s_byte_len+s2c_byte_len) count, link_num linkNum ,c2s_pkt_num c2sPktNum,s2c_pkt_num s2cPktNum,c2s_byte_len c2sByteLen,s2c_byte_len s2cByteLen,date_format(stat_time, '%Y-%m-%d %H:%i:%s') statTime FROM traffic_ip_active_statistic
WHERE ip_addr=#{ipAddr} WHERE ip_addr=#{ipAddr}
and <![CDATA[ stat_time> #{beginDate} and stat_time<=#{endDate}]]> GROUP BY statTime and <![CDATA[ stat_time>= #{beginDate} and stat_time<#{endDate}]]> GROUP BY statTime
ORDER BY count DESC LIMIT 1 ORDER BY count DESC LIMIT 1
</select> </select>

View File

@@ -29,7 +29,7 @@
SELECT proto_type,SUM(link_num) AS link_num,SUM(c2s_pkt_num+s2c_pkt_num) AS packets, 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)*8)/300/1024/1024/1024) AS GByte ((SUM(c2s_byte_len+s2c_byte_len)*8)/300/1024/1024/1024) AS GByte
FROM traffic_protocol_statistic WHERE FROM traffic_protocol_statistic WHERE
<![CDATA[ stat_time>= #{beginTime} and stat_time<= #{endTime}]]> <![CDATA[ stat_time>= #{beginTime} and stat_time< #{endTime}]]>
<if test="protoType!=null"> <if test="protoType!=null">
and proto_type in and proto_type in
<foreach collection="protoType" index="index" item="item" open="(" separator="," close=")"> <foreach collection="protoType" index="index" item="item" open="(" separator="," close=")">

View File

@@ -580,6 +580,7 @@ public class DashboardService extends BaseService {
* @return * @return
*/ */
public List<HashMap> ipActiveOneHour(Date beginDate, Date endDate) { public List<HashMap> ipActiveOneHour(Date beginDate, Date endDate) {
// TrafficIpActiveStatistic maxStatTime = trafficIpActiveStatisticDao.getMaxStatTime(); // TrafficIpActiveStatistic maxStatTime = trafficIpActiveStatisticDao.getMaxStatTime();
ArrayList<HashMap> listMap = new ArrayList<HashMap>(); ArrayList<HashMap> listMap = new ArrayList<HashMap>();
// if (maxStatTime != null && maxStatTime.getStatTime() != null) { // if (maxStatTime != null && maxStatTime.getStatTime() != null) {
@@ -599,6 +600,7 @@ public class DashboardService extends BaseService {
// } // }
return listMap; return listMap;
} }
/** /**