删除日志统计和日志报表接口

This commit is contained in:
zhangdongxu
2017-12-22 15:22:11 +08:00
parent 9bcc1211c6
commit ed111ec4b8
149 changed files with 44 additions and 20019 deletions

View File

@@ -1,25 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.restful.DfDjLogStatistics;
import com.nis.domain.restful.DfDjPzLogStatistics;
/**
* @ClassName: DfDjLogStatDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年11月14日 下午4:00:00
* @version V1.0
*/
@MyBatisDao
public interface DfDjLogStatDao {
List<DfDjLogStatistics> findDfLogStatistics(DfDjLogStatistics entity);
List<DfDjPzLogStatistics> findDfPzLogStatistics(DfDjPzLogStatistics entity);
List<DfDjLogStatistics> findDjLogStatistics(DfDjLogStatistics entity);
List<DfDjPzLogStatistics> findDjPzLogStatistics(DfDjPzLogStatistics entity);
}

View File

@@ -1,150 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfDjLogStatDao">
<!-- DfDjLogStatistics -->
<sql id="DfDjLogStatPorperty">SUM</sql>
<resultMap id="DfDjLogStatisticsMap" type="com.nis.domain.restful.DfDjLogStatistics">
<result column="sum" jdbcType="BIGINT" property="sum" />
</resultMap>
<select id="findDfLogStatistics" parameterType="com.nis.domain.restful.DfDjLogStatistics"
resultMap="DfDjLogStatisticsMap">
SELECT
<include refid="DfDjLogStatPorperty"/>
FROM (SELECT nvl(sum(SUM), 0) SUM
FROM DF_STAT_LOG_DAILY t
<where>
<if test="searchStatActiveSys != null and searchStatActiveSys !=''">
AND active_sys=#{searchStatActiveSys}
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
AND config_id in (${searchConfigId})
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
) DF_STAT_LOG_DAILY
</select>
<select id="findDjLogStatistics" parameterType="com.nis.domain.restful.DfDjLogStatistics"
resultMap="DfDjLogStatisticsMap">
SELECT
<include refid="DfDjLogStatPorperty"/>
FROM (SELECT nvl(sum(SUM), 0) SUM
FROM DJ_STAT_LOG_DAILY t
<where>
<if test="searchStatActiveSys != null and searchStatActiveSys !=''">
AND active_sys=#{searchStatActiveSys}
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
AND config_id in (${searchConfigId})
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
) DJ_STAT_LOG_DAILY
</select>
<!-- DfDjPzLogStatistics -->
<sql id="DfDjPzLogStatPorperty">CONFIG_ID, SERVICE, STAT_TIME, SUM</sql>
<resultMap id="DfDjPzLogStatisticsMap" type="com.nis.domain.restful.DfDjPzLogStatistics">
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="sum" jdbcType="BIGINT" property="sum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="findDfPzLogStatistics" parameterType="com.nis.domain.restful.DfDjPzLogStatistics"
resultMap="DfDjPzLogStatisticsMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfDjPzLogStatPorperty"/>
</otherwise>
</choose>
FROM (SELECT CONFIG_ID, SERVICE, STAT_TIME, sum(SUM) SUM
FROM DF_STAT_LOG_DAILY t
<where>
<if test="searchStatActiveSys != null and searchStatActiveSys !=''">
AND active_sys=#{searchStatActiveSys}
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
AND config_id in(${searchConfigId})
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY CONFIG_ID, SERVICE, STAT_TIME) DF_STAT_LOG_DAILY
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDjPzLogStatistics" parameterType="com.nis.domain.restful.DfDjPzLogStatistics"
resultMap="DfDjPzLogStatisticsMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfDjPzLogStatPorperty"/>
</otherwise>
</choose>
FROM (SELECT CONFIG_ID, SERVICE, STAT_TIME, sum(SUM) SUM
FROM DJ_STAT_LOG_DAILY t
<where>
<if test="searchStatActiveSys != null and searchStatActiveSys !=''">
AND active_sys=#{searchStatActiveSys}
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
AND config_id in(${searchConfigId})
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY CONFIG_ID, SERVICE, STAT_TIME) DJ_STAT_LOG_DAILY
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,13 +0,0 @@
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DfDjNestLog;
@MyBatisDao
public interface DfDjNestLogDao extends CrudDao<Serializable> {
List<DfDjNestLog> findDfDjNestLogPage(DfDjNestLog entity);
}

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfDjNestLogDao">
<!-- OVER_INFO_LOG -->
<sql id="dfDjNestLogProperty">
LAYER_ID,FOUND_TIME,RECV_TIME,LAYER_CNT,NEST_PROTOCOL,NEST_SERVER_IP,
NEST_CLIENT_IP,NEST_SERVER_PORT,NEST_CLIENT_PORT,OVER_ID
</sql>
<resultMap id="DfDjNestLogMap" type="com.nis.domain.restful.DfDjNestLog">
<result column="layer_id" jdbcType="VARCHAR" property="layerId" />
<result column="found_time" jdbcType="TIMESTAMP" property="foundTime" />
<result column="recv_time" jdbcType="TIMESTAMP" property="recvTime" />
<result column="layer_cnt" jdbcType="INTEGER" property="layerCnt" />
<result column="nest_protocol" jdbcType="VARCHAR" property="nestProtocol" />
<result column="nest_server_ip" jdbcType="VARCHAR" property="nestServerIp" />
<result column="nest_client_ip" jdbcType="VARCHAR" property="nestClientIp" />
<result column="nest_server_port" jdbcType="INTEGER" property="nestServerPort" />
<result column="nest_client_port" jdbcType="INTEGER" property="nestClientPort" />
<result column="over_id" jdbcType="VARCHAR" property="overId" />
</resultMap>
<select id="findDfDjNestLogPage" parameterType="com.nis.domain.restful.DfDjNestLog"
resultMap="DfDjNestLogMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dfDjNestLogProperty"/>
</otherwise>
</choose>
FROM OVER_INFO_LOG t
CONNECT BY t.layer_id = prior t.over_id
START WITH t.layer_id = #{searchLayerId}
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,45 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.restful.DfJitAffairDestReport;
import com.nis.domain.restful.DfJitAffairSrcReport;
import com.nis.domain.restful.DfJitFlDestReport;
import com.nis.domain.restful.DfJitFlSrcReport;
import com.nis.domain.restful.DfJitGuaranteeDestReport;
import com.nis.domain.restful.DfJitGuaranteeSrcReport;
import com.nis.domain.restful.DfJitIdDestReport;
import com.nis.domain.restful.DfJitIdSrcReport;
import com.nis.domain.restful.DfJitMissionDestReport;
import com.nis.domain.restful.DfJitMissionSrcReport;
import com.nis.domain.restful.DfJitTagDestReport;
import com.nis.domain.restful.DfJitTagSrcReport;
@MyBatisDao
public interface DfJitLogSearchDao {
List<DfJitFlSrcReport> findDfJitFlSrcReport(DfJitFlSrcReport dfJitFlSrcReportSources);
List<DfJitFlDestReport> findDfJitFlDestReport(DfJitFlDestReport dfJitFlDestReport);
List<DfJitAffairSrcReport> findDfJitAffairSrcReport(DfJitAffairSrcReport dfJitAffairSrcReport);
List<DfJitAffairDestReport> findDfJitAffairDestReport(DfJitAffairDestReport dfJitAffairDestReport);
List<DfJitMissionSrcReport> findDfJitMissionSrcReport(DfJitMissionSrcReport dfJitMissionSrcReport);
List<DfJitMissionDestReport> findDfJitMissionDestReport(DfJitMissionDestReport dfJitMissionDestReport);
List<DfJitGuaranteeSrcReport> findDfJitGuaranteeSrcReport(DfJitGuaranteeSrcReport dfJitGuaranteeSrcReport);
List<DfJitGuaranteeDestReport> findDfJitGuaranteeDestReport(DfJitGuaranteeDestReport dfJitGuaranteeDestReport);
List<DfJitTagSrcReport> findDfJitTagSrcReport(DfJitTagSrcReport dfJitTagSrcReport);
List<DfJitTagDestReport> findDfJitTagDestReport(DfJitTagDestReport dfJitTagDestReport);
List<DfJitIdSrcReport> findDfJitIdSrcReport(DfJitIdSrcReport dfJitIdSrcReport);
List<DfJitIdDestReport> findDfJitIdDestReport(DfJitIdDestReport dfJitIdDestReport);
}

View File

@@ -1,692 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfJitLogSearchDao">
<resultMap id="DfJitFlSrcReportMap" type="com.nis.domain.restful.DfJitFlSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="FL" jdbcType="INTEGER" property="fl" />
<result column="XZ" jdbcType="INTEGER" property="xz" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitFlSrcReport_Column_List">
STAT_ID, FL, XZ, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitFlSrcReport" parameterType="com.nis.domain.restful.DfJitFlSrcReport"
resultMap="DfJitFlSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitFlSrcReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_FL_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchFl != null and searchFl !=''">
AND FL = #{searchFl}
</if>
<if test="searchXz != null and searchXz !=''">
AND XZ = #{searchXz}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitFlDestReportMap" type="com.nis.domain.restful.DfJitFlDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="FL" jdbcType="INTEGER" property="fl" />
<result column="XZ" jdbcType="INTEGER" property="xz" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitFlDestReport_Column_List">
STAT_ID, FL, XZ, REPORT_TIME, DEST_COUNTRY, DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitFlDestReport" parameterType="com.nis.domain.restful.DfJitFlDestReport"
resultMap="DfJitFlDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitFlDestReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_FL_Dest_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchFl != null and searchFl !=''">
AND FL = #{searchFl}
</if>
<if test="searchXz != null and searchXz !=''">
AND XZ = #{searchXz}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitAffairSrcReportMap" type="com.nis.domain.restful.DfJitAffairSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="Affair" jdbcType="INTEGER" property="affair" />
<result column="topic" jdbcType="INTEGER" property="topic" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitAffairSrcReport_Column_List">
STAT_ID, Affair,topic, REPORT_TIME, SRC_COUNTRY,
SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitAffairSrcReport" parameterType="com.nis.domain.restful.DfJitAffairSrcReport"
resultMap="DfJitAffairSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitAffairSrcReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_AFFAIR_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchAffair != null and searchAffair !=''">
AND Affair = #{searchAffair}
</if>
<if test="searchTopic != null and searchTopic !=''">
AND topic = #{searchTopic}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitAffairDestReportMap" type="com.nis.domain.restful.DfJitAffairDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="Affair" jdbcType="INTEGER" property="affair" />
<result column="topic" jdbcType="INTEGER" property="topic" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitAffairDestReport_Column_List">
STAT_ID, Affair,topic, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitAffairDestReport" parameterType="com.nis.domain.restful.DfJitAffairDestReport"
resultMap="DfJitAffairDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitAffairDestReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_AFFAIR_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchAffair != null and searchAffair !=''">
AND Affair = #{searchAffair}
</if>
<if test="searchTopic != null and searchTopic !=''">
AND topic = #{searchTopic}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitMissionSrcReportMap" type="com.nis.domain.restful.DfJitMissionSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="mission" jdbcType="INTEGER" property="mission" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitMissionSrcReport_Column_List">
STAT_ID, mission, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitMissionSrcReport" parameterType="com.nis.domain.restful.DfJitMissionSrcReport"
resultMap="DfJitMissionSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitMissionSrcReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_MISSION_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchMission != null and searchMission !=''">
AND mission = #{searchMission}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitMissionDestReportMap" type="com.nis.domain.restful.DfJitMissionDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="mission" jdbcType="INTEGER" property="mission" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitMissionDestReport_Column_List">
STAT_ID, mission, REPORT_TIME, DEST_COUNTRY, DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitMissionDestReport" parameterType="com.nis.domain.restful.DfJitMissionDestReport"
resultMap="DfJitMissionDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitMissionDestReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_MISSION_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchMission != null and searchMission !=''">
AND mission = #{searchMission}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitGuaranteeSrcReportMap"
type="com.nis.domain.restful.DfJitGuaranteeSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="guarantee" jdbcType="INTEGER" property="guarantee" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitGuaranteeSrcReport_Column_List">
STAT_ID, guarantee, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitGuaranteeSrcReport" parameterType="com.nis.domain.restful.DfJitGuaranteeSrcReport"
resultMap="DfJitGuaranteeSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitGuaranteeSrcReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_GUARANTEE_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchGuarantee != null and searchGuarantee !=''">
AND guarantee = #{searchGuarantee}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitGuaranteeDestReportMap"
type="com.nis.domain.restful.DfJitGuaranteeDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="guarantee" jdbcType="INTEGER" property="guarantee" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitGuaranteeDestReport_Column_List">
STAT_ID, guarantee, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitGuaranteeDestReport" parameterType="com.nis.domain.restful.DfJitGuaranteeDestReport"
resultMap="DfJitGuaranteeDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitGuaranteeDestReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_GUARANTEE_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchGuarantee != null and searchGuarantee !=''">
AND guarantee = #{searchGuarantee}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitTagSrcReportMap" type="com.nis.domain.restful.DfJitTagSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitTagSrcReport_Column_List">
STAT_ID, tag, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitTagSrcReport" parameterType="com.nis.domain.restful.DfJitTagSrcReport"
resultMap="DfJitTagSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitTagSrcReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_TAG_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in(${searchTag})
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitTagDestReportMap" type="com.nis.domain.restful.DfJitTagDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitTagDestReport_Column_List">
STAT_ID, tag, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitTagDestReport" parameterType="com.nis.domain.restful.DfJitTagDestReport"
resultMap="DfJitTagDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitTagDestReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_TAG_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in(${searchTag})
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitIdSrcReportMap" type="com.nis.domain.restful.DfJitIdSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="id" jdbcType="BIGINT" property="id" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitIdSrcReport_Column_List">
STAT_ID, id, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitIdSrcReport" parameterType="com.nis.domain.restful.DfJitIdSrcReport"
resultMap="DfJitIdSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitIdSrcReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_ID_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchId != null and searchId !=''">
AND id = #{searchId}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfJitIdDestReportMap" type="com.nis.domain.restful.DfJitIdDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="id" jdbcType="BIGINT" property="id" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DfJitIdDestReport_Column_List">
STAT_ID, id, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDfJitIdDestReport" parameterType="com.nis.domain.restful.DfJitIdDestReport"
resultMap="DfJitIdDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DfJitIdDestReport_Column_List" />
</otherwise>
</choose>
from DF_JIT_ID_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchId != null and searchId !=''">
AND id = #{searchId}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,43 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.DfReportEntity;
import com.nis.domain.restful.DfAttrTypeReport;
import com.nis.domain.restful.DfDestIpCountryReport;
import com.nis.domain.restful.DfDestIpReport;
import com.nis.domain.restful.DfEntranceReport;
import com.nis.domain.restful.DfLwhhAttrReport;
import com.nis.domain.restful.DfLwhhReport;
import com.nis.domain.restful.DfLwhhTagReport;
import com.nis.domain.restful.DfPzReport;
import com.nis.domain.restful.DfPzReportStat;
import com.nis.domain.restful.DfServiceReport;
import com.nis.domain.restful.DfSrcIpAttrReport;
import com.nis.domain.restful.DfSrcIpDomeSticReport;
import com.nis.domain.restful.DfSrcIpReport;
import com.nis.domain.restful.DfSrcIpTagReport;
import com.nis.domain.restful.DfTagReport;
/**
*
* @ClassName: DfMultiDimensionnalReportDao
* @Description: TODO(一句话描述这个类)
* @author (DDM)
* @date 2017年8月4日下午4:46:31
* @version V1.0
*/
@MyBatisDao
public interface DfMultiDimensionalReportDao extends CrudDao<DfReportEntity> {
List<DfLwhhAttrReport> findDfLwhhAttrReport(DfLwhhAttrReport pz);
List<DfLwhhTagReport> findDfLwhhTagReportPage(DfLwhhTagReport pz);
List<DfSrcIpAttrReport> findDfSrcIpAttrReportPage(DfSrcIpAttrReport pz);
List<DfSrcIpTagReport> findDfSrcIpTagReportPage(DfSrcIpTagReport pz);
}

View File

@@ -1,230 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfMultiDimensionalReportDao">
<!-- 所有实时统计report表的公共属性 -->
<sql id="commonPorperty">
ASUM,BSUM,REPORT_TIME,SERVICE
</sql>
<resultMap id="DfLwhhAttrReportMap" type="com.nis.domain.restful.DfLwhhAttrReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="LWHH" jdbcType="BIGINT" property="lwhh" />
<result column="ATTR_TYPE" jdbcType="BIGINT" property="attrType" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDfLwhhAttrReport" parameterType="com.nis.domain.restful.DfLwhhAttrReport"
resultMap="DfLwhhAttrReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,LWHH,ATTR_TYPE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.LWHH,
pz.ATTR_TYPE
FROM DF_LWHH_TYPE_REPORT PZ
GROUP BY PZ.LWHH,PZ.ATTR_TYPE, PZ.SERVICE, PZ.REPORT_TIME
) DF_LWHH_TYPE_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfLwhhTagReportMap" type="com.nis.domain.restful.DfLwhhTagReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="LWHH" jdbcType="BIGINT" property="lwhh" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDfLwhhTagReportPage" parameterType="com.nis.domain.restful.DfLwhhTagReport"
resultMap="DfLwhhTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,LWHH,TAG
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.LWHH,
pz.TAG
FROM DF_LWHH_TAG_REPORT PZ
GROUP BY PZ.LWHH,PZ.TAG, PZ.SERVICE, PZ.REPORT_TIME
) DF_LWHH_TAG_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG in (${searchTag})
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpTagReportMap" type="com.nis.domain.restful.DfSrcIpTagReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDfSrcIpTagReportPage" parameterType="com.nis.domain.restful.DfSrcIpTagReport"
resultMap="DfSrcIpTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,SRC_PROVINCE,TAG
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.SRC_PROVINCE,
pz.TAG
FROM DF_SRCIP_DOMESTIC_TAG_REPORT PZ
GROUP BY PZ.SRC_PROVINCE,PZ.TAG, PZ.SERVICE, PZ.REPORT_TIME
) DF_SRCIP_DOMESTIC_TAG_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG in (${searchTag})
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpAttrReportMap" type="com.nis.domain.restful.DfSrcIpAttrReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="ATTR_TYPE" jdbcType="BIGINT" property="attrType" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDfSrcIpAttrReportPage" parameterType="com.nis.domain.restful.DfSrcIpAttrReport"
resultMap="DfSrcIpAttrReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,SRC_PROVINCE,ATTR_TYPE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.SRC_PROVINCE,
pz.ATTR_TYPE
FROM DF_SRCIP_DOMESTIC_TYPE_REPORT PZ
GROUP BY PZ.SRC_PROVINCE,PZ.ATTR_TYPE, PZ.SERVICE, PZ.REPORT_TIME
) DF_SRCIP_DOMESTIC_TYPE_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,40 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DfLwhhAttrDaily;
import com.nis.domain.restful.DfLwhhAttrMonth;
import com.nis.domain.restful.DfLwhhTagDaily;
import com.nis.domain.restful.DfLwhhTagMonth;
import com.nis.domain.restful.DfSrcIpAttrDaily;
import com.nis.domain.restful.DfSrcIpAttrMonth;
import com.nis.domain.restful.DfSrcIpTagDaily;
import com.nis.domain.restful.DfSrcIpTagMonth;
/**
*
* @ClassName: DfMultiDimensionnalReportDao
* @Description: TODO(一句话描述这个类)
* @author (DDM)
* @date 2017年8月4日下午4:46:31
* @version V1.0
*/
@MyBatisDao
public interface DfMultiDimensionalStatLogDao extends CrudDao<LogEntity> {
List<DfLwhhAttrDaily> dfLwhhAttrDaily(DfLwhhAttrDaily pz);
List<DfLwhhAttrMonth> dfLwhhAttrMonth(DfLwhhAttrMonth pz);
List<DfLwhhTagDaily> dfLwhhTagDaily(DfLwhhTagDaily pz);
List<DfLwhhTagMonth> dfLwhhTagMonth(DfLwhhTagMonth pz);
List<DfSrcIpAttrDaily> dfSrcIpAttrDaily(DfSrcIpAttrDaily pz);
List<DfSrcIpAttrMonth> dfSrcIpAttrMonth(DfSrcIpAttrMonth pz);
List<DfSrcIpTagDaily> dfSrcIpTagDaily(DfSrcIpTagDaily pz);
List<DfSrcIpTagMonth> dfSrcIpTagMonth(DfSrcIpTagMonth pz);
}

View File

@@ -1,475 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfMultiDimensionalStatLogDao">
<!-- 配置报表的公共属性 -->
<sql id="commonPorperty">
ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfLwhhAttrDailyMap" type="com.nis.domain.restful.DfLwhhAttrDaily">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfLwhhAttrDaily" parameterType="com.nis.domain.restful.DfLwhhAttrDaily" resultMap="DfLwhhAttrDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select LWHH,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_LWHH_TYPE_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,ATTR_TYPE,service,stat_time
) DF_LWHH_TYPE_STAT_LOG_DAILY
GROUP BY LWHH,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfLwhhAttrMonthMap" type="com.nis.domain.restful.DfLwhhAttrMonth">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfLwhhAttrMonth" parameterType="com.nis.domain.restful.DfLwhhAttrMonth" resultMap="DfLwhhAttrMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select LWHH,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_LWHH_TYPE_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,ATTR_TYPE,service,stat_time
) DF_LWHH_TYPE_STAT_LOG_MONTH
GROUP BY LWHH,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfLwhhTagDailyMap" type="com.nis.domain.restful.DfLwhhTagDaily">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfLwhhTagDaily" parameterType="com.nis.domain.restful.DfLwhhTagDaily" resultMap="DfLwhhTagDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,TAG
</otherwise>
</choose>
FROM
(
select LWHH,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_LWHH_TAG_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,TAG,service,stat_time
) DF_LWHH_TAG_STAT_LOG_DAILY
GROUP BY LWHH,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfLwhhTagMonthMap" type="com.nis.domain.restful.DfLwhhTagMonth">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfLwhhTagMonth" parameterType="com.nis.domain.restful.DfLwhhTagMonth" resultMap="DfLwhhTagMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,TAG
</otherwise>
</choose>
FROM
(
select LWHH,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_LWHH_TAG_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,TAG,service,stat_time
) DF_LWHH_TAG_STAT_LOG_MONTH
GROUP BY LWHH,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpAttrDailyMap" type="com.nis.domain.restful.DfSrcIpAttrDaily">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfSrcIpAttrDaily" parameterType="com.nis.domain.restful.DfSrcIpAttrDaily" resultMap="DfSrcIpAttrDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_SRCIP_TYPE_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,ATTR_TYPE,service,stat_time
) DF_SRCIP_TYPE_STAT_LOG_DAILY
GROUP BY SRC_PROVINCE,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpAttrMonthMap" type="com.nis.domain.restful.DfSrcIpAttrMonth">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfSrcIpAttrMonth" parameterType="com.nis.domain.restful.DfSrcIpAttrMonth" resultMap="DfSrcIpAttrMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_SRCIP_TYPE_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,ATTR_TYPE,service,stat_time
) DF_SRCIP_TYPE_STAT_LOG_MONTH
GROUP BY SRC_PROVINCE,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpTagDailyMap" type="com.nis.domain.restful.DfSrcIpTagDaily">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfSrcIpTagDaily" parameterType="com.nis.domain.restful.DfSrcIpTagDaily" resultMap="DfSrcIpTagDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,TAG
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_SRCIP_TAG_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,TAG,service,stat_time
) DF_SRCIP_TAG_STAT_LOG_DAILY
GROUP BY SRC_PROVINCE,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpTagMonthMap" type="com.nis.domain.restful.DfSrcIpTagMonth">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="dfSrcIpTagMonth" parameterType="com.nis.domain.restful.DfSrcIpTagMonth" resultMap="DfSrcIpTagMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,TAG
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_SRCIP_TAG_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,TAG,service,stat_time
) DF_SRCIP_TAG_STAT_LOG_MONTH
GROUP BY SRC_PROVINCE,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,58 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.DfReportEntity;
import com.nis.domain.restful.DfAttrTypeReport;
import com.nis.domain.restful.DfDestIpCountryReport;
import com.nis.domain.restful.DfDestIpReport;
import com.nis.domain.restful.DfEntranceReport;
import com.nis.domain.restful.DfLwhhReport;
import com.nis.domain.restful.DfPzReport;
import com.nis.domain.restful.DfPzReportStat;
import com.nis.domain.restful.DfServiceReport;
import com.nis.domain.restful.DfSrcIpDomeSticReport;
import com.nis.domain.restful.DfSrcIpReport;
import com.nis.domain.restful.DfTagReport;
/**
*
* @ClassName: DfReportDao
* @Description: TODO(一句话描述这个类)
* @author (DDM)
* @date 2016年10月31日上午11:51:26
* @version V1.0
*/
@MyBatisDao
public interface DfReportDao extends CrudDao<DfReportEntity> {
List<DfPzReport> findDfPzReport(DfPzReport pz);
List<DfAttrTypeReport> findAttrTypeReport(DfAttrTypeReport pz);
List<DfSrcIpDomeSticReport> findSrcIpDomeSticReport(DfSrcIpDomeSticReport pz);
List<DfDestIpCountryReport> findDestIpCountryReport(DfDestIpCountryReport pz);
List<DfEntranceReport> findDfEntranceReport(DfEntranceReport pz);
List<DfLwhhReport> findDfLwhhReport(DfLwhhReport pz);
List<DfTagReport> findDfTagReportPage(DfTagReport pz);
List<DfPzReport> findDfPriTagReport(DfPzReport pz);
List<DfPzReportStat> findDfPzReportStat(DfPzReportStat pz);
List<DfPzReportStat> findDfPzReportStatMinutes(DfPzReportStat pz);
Long findDfPzReportSum(DfPzReportStat pz);
List<DfSrcIpReport> findDfSrcIpReport(DfSrcIpReport entity);
List<DfDestIpReport> findDfDestIpReport(DfDestIpReport entity);
List<DfServiceReport> findDfServiceReport(DfServiceReport pz);
List<DfTagReport> findDfTagReport(DfTagReport pz);
}

View File

@@ -1,824 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfReportDao">
<!-- 所有实时统计report表的公共属性 -->
<sql id="commonPorperty">
ASUM,BSUM,REPORT_TIME
</sql>
<sql id="commonABPorperty">
ASUM,BSUM,ABSUM,REPORT_TIME
</sql>
<resultMap id="DfPzReportMap" type="com.nis.domain.restful.DfPzReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="ABSUM" jdbcType="BIGINT" property="absum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="CFG_ID" jdbcType="BIGINT" property="cfgId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<resultMap id="DfPzReportStatMap" type="com.nis.domain.restful.DfPzReportStat">
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="CFG_ID" jdbcType="BIGINT" property="configId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<resultMap id="DfAttrTypeReportMap" type="com.nis.domain.restful.DfAttrTypeReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="ABSUM" jdbcType="BIGINT" property="absum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="ATTR_TYPE" jdbcType="INTEGER" property="attrType" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<resultMap id="DfSrcIpDomeSticReportMap" type="com.nis.domain.restful.DfSrcIpDomeSticReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
</resultMap>
<resultMap id="DfDestIpCountryReportMap" type="com.nis.domain.restful.DfDestIpCountryReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<!-- DfPzReport日志查询 -->
<sql id="dfPzReportPorperty">
,CFG_ID,SERVICE
</sql>
<select id="findDfPzReport" parameterType="com.nis.domain.restful.DfPzReport"
resultMap="DfPzReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />
<include refid="dfPzReportPorperty" />
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.CFG_ID,
PZ.SERVICE
FROM DF_PZ_REPORT PZ
GROUP BY
PZ.CFG_ID,
PZ.SERVICE, PZ.REPORT_TIME
) DF_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchCfgId != null and searchCfgId !=''">
AND CFG_ID =#{searchCfgId}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findAttrTypeReport" parameterType="com.nis.domain.restful.DfAttrTypeReport"
resultMap="DfAttrTypeReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,absum,REPORT_TIME,ATTR_TYPE,SERVICE
</otherwise>
</choose>
FROM (
SELECT attr_type,REPORT_TIME, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select attr_type, asum, bsum, absum, REPORT_TIME,service
from (select attr_type,
REPORT_TIME,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.REPORT_TIME,
pz.cfg_id,
pz.attr_type,pz.service
FROM df_pz_attr_report PZ
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
GROUP BY pz.cfg_id, pz.attr_type, PZ.REPORT_TIME,pz.service)) a)
group by attr_type, REPORT_TIME,service
) df_pz_attr_report
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findSrcIpDomeSticReport" parameterType="com.nis.domain.restful.DfSrcIpDomeSticReport"
resultMap="DfSrcIpDomeSticReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,SRC_PROVINCE,SRC_CITY
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.SRC_PROVINCE,pz.SRC_CITY
FROM
DF_SRCIP_DOMESTIC_REPORT PZ
GROUP BY PZ.SRC_PROVINCE,pz.SRC_CITY,
PZ.SERVICE, PZ.REPORT_TIME
) DF_SRCIP_DOMESTIC_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchSrcCity != null and searchSrcCity !=''">
AND SRC_CITY =#{searchSrcCity}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDestIpCountryReport" parameterType="com.nis.domain.restful.DfDestIpCountryReport"
resultMap="DfDestIpCountryReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,DEST_COUNTRY,SERVICE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.DEST_COUNTRY
FROM DF_DESTIP_COUNTRY_REPORT
PZ
GROUP BY PZ.DEST_COUNTRY, PZ.SERVICE, PZ.REPORT_TIME
)
DF_DESTIP_COUNTRY_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchDestCountry != null and searchDestCountry !=''">
AND DEST_COUNTRY =#{searchDestCountry}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDfPriTagReport" parameterType="com.nis.domain.restful.DfPzReport"
resultMap="DfPzReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,ABSUM,SERVICE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 OR PZ.CFG_ID IN (SELECT DISTINCT CFG_ID
FROM
DF_PZ_REPORT T WHERE T.ACTIVE_SYS = 2 AND T.CFG_ID NOT IN
(SELECT
CFG_ID FROM DF_PZ_REPORT B WHERE B.ACTIVE_SYS = 4)) THEN
SUM ELSE 0
END) ABSUM,
PZ.SERVICE
FROM DF_PZ_REPORT PZ
GROUP BY PZ.SERVICE
)
DF_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDfPzReportStat" parameterType="com.nis.domain.restful.DfPzReportStat"
resultMap="DfPzReportStatMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
CFG_ID,SERVICE,SUM
</otherwise>
</choose>
FROM (
<choose>
<when test="searchStatActiveSys == 6 ">
SELECT CFG_ID,SERVICE, DECODE(ASUM,0,BSUM,ASUM) SUM FROM (
SELECT config_id CFG_ID, SERVICE,
SUM(CASE WHEN ACTIVE_SYS=4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN ACTIVE_SYS=2 THEN SUM ELSE 0 END) BSUM
FROM df_stat_log_hour
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND stat_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND stat_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
</where>
GROUP BY config_id,SERVICE
) REPORT
</when>
<otherwise>
SELECT
config_id cfg_id,SERVICE,SUM(sum) SUM
FROM df_stat_log_hour
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND stat_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND stat_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
AND active_sys=#{searchStatActiveSys}
</where>
GROUP BY config_id,SERVICE
</otherwise>
</choose>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDfPzReportStatMinutes" parameterType="com.nis.domain.restful.DfPzReportStat"
resultMap="DfPzReportStatMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
CFG_ID,SERVICE,SUM
</otherwise>
</choose>
FROM (
<choose>
<when test="searchStatActiveSys == 6 ">
SELECT CFG_ID,SERVICE, DECODE(ASUM,0,BSUM,ASUM) SUM FROM (
SELECT CFG_ID, SERVICE,
SUM(CASE WHEN ACTIVE_SYS=4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN ACTIVE_SYS=2 THEN SUM ELSE 0 END) BSUM
FROM DF_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
</where>
GROUP BY CFG_ID,SERVICE
) REPORT
</when>
<otherwise>
SELECT
CFG_ID,SERVICE,SUM(sum) SUM
FROM DF_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
AND active_sys=#{searchStatActiveSys}
</where>
GROUP BY CFG_ID,SERVICE
</otherwise>
</choose>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDfPzReportSum" parameterType="com.nis.domain.restful.DfPzReportStat"
resultType="java.lang.Long">
SELECT
SUM(sum) SUM
FROM DF_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
AND active_sys=#{searchStatActiveSys}
</where>
</select>
<resultMap id="DfServiceReportMap" type="com.nis.domain.restful.DfServiceReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="CSUM" jdbcType="BIGINT" property="csum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SERVICE" jdbcType="INTEGER" property="serviceType" />
</resultMap>
<!-- DfServiceReport日志查询 -->
<sql id="dfServiceReportPorperty">
,service
</sql>
<select id="findDfServiceReport" parameterType="com.nis.domain.restful.DfServiceReport"
resultMap="DfServiceReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />
<include refid="dfServiceReportPorperty" />
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 1 THEN SUM ELSE 0 END) CSUM,
PZ.REPORT_TIME,
PZ.SERVICE
FROM DF_SERVICE_REPORT PZ
GROUP BY PZ.SERVICE, PZ.REPORT_TIME
) DF_SERVICE_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfTagReportMap" type="com.nis.domain.restful.DfTagReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="ABSUM" jdbcType="BIGINT" property="absum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="TAG" jdbcType="INTEGER" property="tag" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<!-- DfTagReport日志查询 -->
<sql id="dfTagReportPorperty">
,tag
</sql>
<select id="findDfTagReportPage" parameterType="com.nis.domain.restful.DfTagReport"
resultMap="DfTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
tag,REPORT_TIME, asum, bsum,absum,service
</otherwise>
</choose>
FROM (
SELECT tag,REPORT_TIME, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, REPORT_TIME,service
from (select tag,
REPORT_TIME,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.REPORT_TIME,
pz.cfg_id,
pz.tag,pz.service
FROM df_pz_tag_report PZ
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in(${searchTag})
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
</where>
GROUP BY pz.cfg_id, pz.tag, PZ.REPORT_TIME,pz.service)) a)
group by tag, REPORT_TIME,service
)
DF_TAG_REPORT
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDfTagReport" parameterType="com.nis.domain.restful.DfTagReport"
resultMap="DfTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
tag,REPORT_TIME, asum, bsum,absum,service
</otherwise>
</choose>
FROM (
SELECT tag,REPORT_TIME, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, REPORT_TIME,service
from (select tag,
REPORT_TIME,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.REPORT_TIME,
pz.cfg_id,
pz.tag,pz.service
FROM df_pz_tag_report PZ
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in(${searchTag})
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
</where>
GROUP BY pz.cfg_id, pz.tag, PZ.REPORT_TIME,pz.service)) a)
group by tag, REPORT_TIME,service
)
DF_TAG_REPORT
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfLwhhReportMap" type="com.nis.domain.restful.DfLwhhReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="lwhh" jdbcType="INTEGER" property="lwhh" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<select id="findDfLwhhReport" parameterType="com.nis.domain.restful.DfLwhhReport"
resultMap="DfLwhhReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,LWHH
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.lwhh,pz.service
FROM DF_LWHH_REPORT PZ
GROUP BY
PZ.lwhh,pz.service, PZ.REPORT_TIME
)
DF_LWHH_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND lwhh=#{searchLwhh}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfEntranceReportMap" type="com.nis.domain.restful.DfEntranceReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entraceId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<select id="findDfEntranceReport" parameterType="com.nis.domain.restful.DfEntranceReport"
resultMap="DfEntranceReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,ENTRANCE_ID
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.ENTRANCE_ID,pz.service
FROM DF_ENTRANCE_REPORT PZ
GROUP BY
PZ.ENTRANCE_ID,pz.service, PZ.REPORT_TIME
)
DF_LWHH_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchEntraceId != null and searchEntraceId !=''">
AND ENTRANCE_ID=#{searchEntraceId}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- DF_SRCIP_DOMESTIC_REPORT -->
<sql id="dfSrcIpPorperty">
,SRC_PROVINCE,SRC_CITY
</sql>
<resultMap id="DfSrcIpReportMap" type="com.nis.domain.restful.DfSrcIpReport">
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="csum" jdbcType="BIGINT" property="csum" />
<result column="report_time" jdbcType="TIMESTAMP" property="reportTime" />
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="src_city" jdbcType="VARCHAR" property="srcCity" />
</resultMap>
<select id="findDfSrcIpReport" parameterType="com.nis.domain.restful.DfSrcIpReport"
resultMap="DfSrcIpReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />
<include refid="dfSrcIpPorperty" />
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN t.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN t.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
SUM(CASE WHEN
t.ACTIVE_SYS = 1 THEN SUM ELSE 0 END) CSUM,
t.SRC_PROVINCE,
t.SRC_CITY
,
t.REPORT_TIME
FROM DF_SRCIP_DOMESTIC_REPORT t
GROUP BY t.SRC_PROVINCE,
t.SRC_CITY, t.REPORT_TIME
) DF_SRCIP_DOMESTIC_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- DF_DESTIP_COUNTRY_REPORT -->
<sql id="dfDestIpPorperty">
,DEST_COUNTRY
</sql>
<resultMap id="DfDestIpReportMap" type="com.nis.domain.restful.DfDestIpReport">
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="csum" jdbcType="BIGINT" property="csum" />
<result column="report_time" jdbcType="TIMESTAMP" property="reportTime" />
<result column="dest_country" jdbcType="VARCHAR" property="destCountry" />
</resultMap>
<select id="findDfDestIpReport" parameterType="com.nis.domain.restful.DfDestIpReport"
resultMap="DfDestIpReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />
<include refid="dfDestIpPorperty" />
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN t.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN t.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
SUM(CASE WHEN
t.ACTIVE_SYS = 1 THEN SUM ELSE 0 END) CSUM,
t.DEST_COUNTRY
,
t.REPORT_TIME
FROM DF_DESTIP_COUNTRY_REPORT t
GROUP BY t.DEST_COUNTRY,
t.REPORT_TIME
) DF_DESTIP_COUNTRY_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,54 +0,0 @@
/**
* @Title: DfStatLogDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author ddm
* @date 2016年9月13日 上午11:21:31
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DfAttrStatLogDaily;
import com.nis.domain.restful.DfAttrStatLogMonth;
import com.nis.domain.restful.DfDestIpCounrtyStatLogDaily;
import com.nis.domain.restful.DfDestIpCounrtyStatLogMonth;
import com.nis.domain.restful.DfEntrStatLogDaily;
import com.nis.domain.restful.DfEntrStatLogMonth;
import com.nis.domain.restful.DfLwhhStatLogDaily;
import com.nis.domain.restful.DfLwhhStatLogMonth;
import com.nis.domain.restful.DfSrcIpDomesticStatLogDaily;
import com.nis.domain.restful.DfSrcIpDomesticStatLogMonth;
import com.nis.domain.restful.DfStatLogDaily;
import com.nis.domain.restful.DfStatLogMonth;
import com.nis.domain.restful.DfTagStatLogDaily;
import com.nis.domain.restful.DfTagStatLogMonth;
/**
* @ClassName: DfStatLogDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ddm)
* @date 2016年9月13日 上午11:21:31
* @version V1.0
*/
@MyBatisDao
public interface DfStatLogDao extends CrudDao<LogEntity> {
List<DfStatLogDaily> dfStatLogDaily(DfStatLogDaily daily);
List<DfStatLogMonth> dfStatLogMonth(DfStatLogMonth mongth);
List<DfTagStatLogDaily> dfTagStatLogDaily(DfTagStatLogDaily daily);
List<DfTagStatLogMonth> dfTagStatLogMonth(DfTagStatLogMonth mongth);
List<DfAttrStatLogDaily> dfAttrStatLogDaily(DfAttrStatLogDaily daily);
List<DfAttrStatLogMonth> dfAttrStatLogMonth(DfAttrStatLogMonth mongth);
List<DfEntrStatLogDaily> dfEntrStatLogDaily(DfEntrStatLogDaily daily);
List<DfEntrStatLogMonth> dfEntrStatLogMonth(DfEntrStatLogMonth mongth);
List<DfLwhhStatLogDaily> dfLwhhStatLogDaily(DfLwhhStatLogDaily daily);
List<DfLwhhStatLogMonth> dfLwhhStatLogMonth(DfLwhhStatLogMonth mongth);
List<DfSrcIpDomesticStatLogDaily> dfSrcIpDomesticStatLogDaily(DfSrcIpDomesticStatLogDaily daily);
List<DfSrcIpDomesticStatLogMonth> dfSrcIpDomesticStatLogMonth(DfSrcIpDomesticStatLogMonth mongth);
List<DfDestIpCounrtyStatLogDaily> dfDestIpCounrtyStatLogDaily(DfDestIpCounrtyStatLogDaily daily);
List<DfDestIpCounrtyStatLogMonth> dfDestIpCounrtyStatLogMonth(DfDestIpCounrtyStatLogMonth mongth);
}

View File

@@ -1,857 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DfStatLogDao">
<!-- 配置报表的公共属性 -->
<sql id="commonPorperty">
CONFIG_ID,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfStatLogDailyMap" type="com.nis.domain.restful.DfStatLogDaily">
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_StatLog_Daily日志查询 -->
<select id="dfStatLogDaily" parameterType="com.nis.domain.restful.DfStatLogDaily" resultMap="DfStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>
</otherwise>
</choose>
FROM
(
select config_id,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select config_id,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
and config_id=#{searchConfigId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by config_id,service,stat_time
) A
GROUP BY config_id,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfStatLogMonthMap" type="com.nis.domain.restful.DfStatLogMonth">
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_Stat_Log_Month日志查询 -->
<select id="dfStatLogMonth" parameterType="com.nis.domain.restful.DfStatLogMonth" resultMap="DfStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>
</otherwise>
</choose>
FROM
(
select config_id,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select config_id,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
and config_id=#{searchConfigId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by config_id,service,stat_time
) A
GROUP BY config_id,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 标签报表的公共属性 -->
<sql id="tagCommonPorperty">
TAG,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfTagStatLogDailyMap" type="com.nis.domain.restful.DfTagStatLogDaily">
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_TAG_Stat_Log_Daily日志查询 -->
<select id="dfTagStatLogDaily" parameterType="com.nis.domain.restful.DfTagStatLogDaily" resultMap="DfTagStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="tagCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT tag,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, stat_time,service
from (select tag,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.tag,pz.service
FROM df_cfg_tag_stat_log_daily PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
and tag=#{searchTag}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.tag, PZ.stat_time,pz.service)) a)
group by tag, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfTagStatLogMonthMap" type="com.nis.domain.restful.DfTagStatLogMonth">
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_Tag_Stat_Log_Month日志查询 -->
<select id="dfTagStatLogMonth" parameterType="com.nis.domain.restful.DfTagStatLogMonth" resultMap="DfTagStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="tagCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT tag,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, stat_time,service
from (select tag,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.tag,pz.service
FROM df_cfg_tag_stat_log_month PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
and tag=#{searchTag}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.tag, PZ.stat_time,pz.service)) a)
group by tag, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 性质报表的公共属性 -->
<sql id="attrCommonPorperty">
attr_type,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfAttrStatLogDailyMap" type="com.nis.domain.restful.DfAttrStatLogDaily">
<result column="attr_type" jdbcType="INTEGER" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_ATTR_Stat_Log_Daily日志查询 -->
<select id="dfAttrStatLogDaily" parameterType="com.nis.domain.restful.DfAttrStatLogDaily" resultMap="DfAttrStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="attrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT attr_type,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select attr_type, asum, bsum, absum, stat_time,service
from (select attr_type,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.attr_type,pz.service
FROM df_cfg_attr_stat_log_daily PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
and attr_type=#{searchAttrType}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.attr_type, PZ.stat_time,pz.service)) a)
group by attr_type, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfAttrStatLogMonthMap" type="com.nis.domain.restful.DfAttrStatLogMonth">
<result column="attr_type" jdbcType="INTEGER" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_Attr_Stat_Log_Month日志查询 -->
<select id="dfAttrStatLogMonth" parameterType="com.nis.domain.restful.DfAttrStatLogMonth" resultMap="DfAttrStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="attrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT attr_type,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select attr_type, asum, bsum, absum, stat_time,service
from (select attr_type,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.attr_type,pz.service
FROM df_cfg_attr_stat_log_month PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
and attr_type=#{searchAttrType}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.attr_type, PZ.stat_time,pz.service)) a)
group by attr_type, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 局点报表的公共属性 -->
<sql id="entrCommonPorperty">
ENTRANCE_ID,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfEntrStatLogDailyMap" type="com.nis.domain.restful.DfEntrStatLogDaily">
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entranceId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_ATTR_Stat_Log_Daily日志查询 -->
<select id="dfEntrStatLogDaily" parameterType="com.nis.domain.restful.DfEntrStatLogDaily" resultMap="DfEntrStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="entrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select ENTRANCE_ID,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select ENTRANCE_ID,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_entr_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchEntranceId != null and searchEntranceId !=''">
and ENTRANCE_ID=#{searchEntranceId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by ENTRANCE_ID,service,stat_time
) A
GROUP BY ENTRANCE_ID,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfEntrStatLogMonthMap" type="com.nis.domain.restful.DfEntrStatLogMonth">
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entranceId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_Entr_Stat_Log_Month日志查询 -->
<select id="dfEntrStatLogMonth" parameterType="com.nis.domain.restful.DfEntrStatLogMonth" resultMap="DfEntrStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="entrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select ENTRANCE_ID,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select ENTRANCE_ID,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_entr_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchEntranceId != null and searchEntranceId !=''">
and ENTRANCE_ID=#{searchEntranceId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by ENTRANCE_ID,service,stat_time
) A
GROUP BY ENTRANCE_ID,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 来文函号报表的公共属性 -->
<sql id="lwhhCommonPorperty">
lwhh,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfLwhhStatLogDailyMap" type="com.nis.domain.restful.DfLwhhStatLogDaily">
<result column="lwhh" jdbcType="INTEGER" property="lwhh" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_ATTR_Stat_Log_Daily日志查询 -->
<select id="dfLwhhStatLogDaily" parameterType="com.nis.domain.restful.DfLwhhStatLogDaily" resultMap="DfLwhhStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="lwhhCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select lwhh,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select lwhh,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_lwhh_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
and lwhh=#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by lwhh,service,stat_time
) A
GROUP BY lwhh,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfLwhhStatLogMonthMap" type="com.nis.domain.restful.DfLwhhStatLogMonth">
<result column="lwhh" jdbcType="INTEGER" property="lwhh" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_Lwhh_Stat_Log_Month日志查询 -->
<select id="dfLwhhStatLogMonth" parameterType="com.nis.domain.restful.DfLwhhStatLogMonth" resultMap="DfLwhhStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="lwhhCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select lwhh,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select lwhh,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DF_lwhh_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
and lwhh=#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by lwhh,service,stat_time
) A
GROUP BY lwhh,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 境内源ip报表的公共属性 -->
<sql id="srcIpCommonPorperty">
SRC_PROVINCE,SRC_CITY,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfSrcIpDomesticStatLogDailyMap" type="com.nis.domain.restful.DfSrcIpDomesticStatLogDaily">
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_SrcIp_Stat_Log_Daily日志查询 -->
<select id="dfSrcIpDomesticStatLogDaily" parameterType="com.nis.domain.restful.DfSrcIpDomesticStatLogDaily" resultMap="DfSrcIpDomesticStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="srcIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,SRC_CITY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,SRC_CITY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from df_SRCIP_stat_log_daily
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,SRC_CITY,service,stat_time
) A
GROUP BY SRC_PROVINCE,SRC_CITY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfSrcIpDomesticStatLogMonthMap" type="com.nis.domain.restful.DfSrcIpDomesticStatLogMonth">
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_SrcIpDomestic_Stat_Log_Month日志查询 -->
<select id="dfSrcIpDomesticStatLogMonth" parameterType="com.nis.domain.restful.DfSrcIpDomesticStatLogMonth" resultMap="DfSrcIpDomesticStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="srcIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,SRC_CITY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,SRC_CITY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from df_SRCIP_stat_log_month
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,SRC_CITY,service,stat_time
) A
GROUP BY SRC_PROVINCE,SRC_CITY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 国家目的ip报表的公共属性 -->
<sql id="destIpCommonPorperty">
DEST_COUNTRY,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DfDestIpCounrtyStatLogDailyMap" type="com.nis.domain.restful.DfDestIpCounrtyStatLogDaily">
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_DestIp_Stat_Log_Daily日志查询 -->
<select id="dfDestIpCounrtyStatLogDaily" parameterType="com.nis.domain.restful.DfDestIpCounrtyStatLogDaily" resultMap="DfDestIpCounrtyStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="destIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select DEST_COUNTRY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select DEST_COUNTRY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from df_DESTIP_stat_log_daily
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by DEST_COUNTRY,service,stat_time
) A
GROUP BY DEST_COUNTRY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DfDestIpCounrtyStatLogMonthMap" type="com.nis.domain.restful.DfDestIpCounrtyStatLogMonth">
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Df_DestIp_Stat_Log_Month日志查询 -->
<select id="dfDestIpCounrtyStatLogMonth" parameterType="com.nis.domain.restful.DfDestIpCounrtyStatLogMonth" resultMap="DfDestIpCounrtyStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="destIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select DEST_COUNTRY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select DEST_COUNTRY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from df_DESTIP_stat_log_Month
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by DEST_COUNTRY,service,stat_time
) A
GROUP BY DEST_COUNTRY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,48 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.restful.DjCkStatLog;
import com.nis.domain.restful.DjJitAffairDestReport;
import com.nis.domain.restful.DjJitAffairSrcReport;
import com.nis.domain.restful.DjJitFlDestReport;
import com.nis.domain.restful.DjJitFlSrcReport;
import com.nis.domain.restful.DjJitGuaranteeDestReport;
import com.nis.domain.restful.DjJitGuaranteeSrcReport;
import com.nis.domain.restful.DjJitIdDestReport;
import com.nis.domain.restful.DjJitIdSrcReport;
import com.nis.domain.restful.DjJitMissionDestReport;
import com.nis.domain.restful.DjJitMissionSrcReport;
import com.nis.domain.restful.DjJitTagDestReport;
import com.nis.domain.restful.DjJitTagSrcReport;
@MyBatisDao
public interface DjJitLogSearchDao {
List<DjJitFlSrcReport> findDjJitFlSrcReport(DjJitFlSrcReport djJitFlSrcReportSources);
List<DjJitFlDestReport> findDjJitFlDestReport(DjJitFlDestReport djJitFlDestReport);
List<DjJitAffairSrcReport> findDjJitAffairSrcReport(DjJitAffairSrcReport djJitAffairSrcReport);
List<DjJitAffairDestReport> findDjJitAffairDestReport(DjJitAffairDestReport djJitAffairDestReport);
List<DjJitMissionSrcReport> findDjJitMissionSrcReport(DjJitMissionSrcReport djJitMissionSrcReport);
List<DjJitMissionDestReport> findDjJitMissionDestReport(DjJitMissionDestReport djJitMissionDestReport);
List<DjJitGuaranteeSrcReport> findDjJitGuaranteeSrcReport(DjJitGuaranteeSrcReport djJitGuaranteeSrcReport);
List<DjJitGuaranteeDestReport> findDjJitGuaranteeDestReport(DjJitGuaranteeDestReport djJitGuaranteeDestReport);
List<DjJitTagSrcReport> findDjJitTagSrcReport(DjJitTagSrcReport djJitTagSrcReport);
List<DjJitTagDestReport> findDjJitTagDestReport(DjJitTagDestReport djJitTagDestReport);
List<DjJitIdSrcReport> findDjJitIdSrcReport(DjJitIdSrcReport djJitIdSrcReport);
List<DjJitIdDestReport> findDjJitIdDestReport(DjJitIdDestReport djJitIdDestReport);
List<DjCkStatLog> findDjCkStatLog(DjCkStatLog djCkStatLog);
}

View File

@@ -1,776 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DjJitLogSearchDao">
<resultMap id="DjJitFlSrcReportMap" type="com.nis.domain.restful.DjJitFlSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="FL" jdbcType="INTEGER" property="fl" />
<result column="XZ" jdbcType="INTEGER" property="xz" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitFlSrcReport_Column_List">
STAT_ID, FL, XZ, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitFlSrcReport" parameterType="com.nis.domain.restful.DjJitFlSrcReport"
resultMap="DjJitFlSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitFlSrcReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_FL_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchFl != null and searchFl !=''">
AND FL = #{searchFl}
</if>
<if test="searchXz != null and searchXz !=''">
AND XZ = #{searchXz}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitFlDestReportMap" type="com.nis.domain.restful.DjJitFlDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="FL" jdbcType="INTEGER" property="fl" />
<result column="XZ" jdbcType="INTEGER" property="xz" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitFlDestReport_Column_List">
STAT_ID, FL, XZ, REPORT_TIME, DEST_COUNTRY, DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitFlDestReport" parameterType="com.nis.domain.restful.DjJitFlDestReport"
resultMap="DjJitFlDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitFlDestReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_FL_Dest_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchFl != null and searchFl !=''">
AND FL = #{searchFl}
</if>
<if test="searchXz != null and searchXz !=''">
AND XZ = #{searchXz}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitAffairSrcReportMap" type="com.nis.domain.restful.DjJitAffairSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="Affair" jdbcType="INTEGER" property="affair" />
<result column="topic" jdbcType="INTEGER" property="topic" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitAffairSrcReport_Column_List">
STAT_ID, Affair,topic, REPORT_TIME, SRC_COUNTRY,
SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitAffairSrcReport" parameterType="com.nis.domain.restful.DjJitAffairSrcReport"
resultMap="DjJitAffairSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitAffairSrcReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_AFFAIR_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchAffair != null and searchAffair !=''">
AND Affair = #{searchAffair}
</if>
<if test="searchTopic != null and searchTopic !=''">
AND topic = #{searchTopic}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitAffairDestReportMap" type="com.nis.domain.restful.DjJitAffairDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="Affair" jdbcType="INTEGER" property="affair" />
<result column="topic" jdbcType="INTEGER" property="topic" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitAffairDestReport_Column_List">
STAT_ID, Affair,topic, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitAffairDestReport" parameterType="com.nis.domain.restful.DjJitAffairDestReport"
resultMap="DjJitAffairDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitAffairDestReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_AFFAIR_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchAffair != null and searchAffair !=''">
AND Affair = #{searchAffair}
</if>
<if test="searchTopic != null and searchTopic !=''">
AND topic = #{searchTopic}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitMissionSrcReportMap" type="com.nis.domain.restful.DjJitMissionSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="mission" jdbcType="INTEGER" property="mission" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitMissionSrcReport_Column_List">
STAT_ID, mission, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitMissionSrcReport" parameterType="com.nis.domain.restful.DjJitMissionSrcReport"
resultMap="DjJitMissionSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitMissionSrcReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_MISSION_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchMission != null and searchMission !=''">
AND mission = #{searchMission}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitMissionDestReportMap" type="com.nis.domain.restful.DjJitMissionDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="mission" jdbcType="INTEGER" property="mission" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitMissionDestReport_Column_List">
STAT_ID, mission, REPORT_TIME, DEST_COUNTRY, DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitMissionDestReport" parameterType="com.nis.domain.restful.DjJitMissionDestReport"
resultMap="DjJitMissionDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitMissionDestReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_MISSION_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchMission != null and searchMission !=''">
AND mission = #{searchMission}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitGuaranteeSrcReportMap"
type="com.nis.domain.restful.DjJitGuaranteeSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="guarantee" jdbcType="INTEGER" property="guarantee" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitGuaranteeSrcReport_Column_List">
STAT_ID, guarantee, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitGuaranteeSrcReport" parameterType="com.nis.domain.restful.DjJitGuaranteeSrcReport"
resultMap="DjJitGuaranteeSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitGuaranteeSrcReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_GUARANTEE_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchGuarantee != null and searchGuarantee !=''">
AND guarantee = #{searchGuarantee}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitGuaranteeDestReportMap"
type="com.nis.domain.restful.DjJitGuaranteeDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="guarantee" jdbcType="INTEGER" property="guarantee" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitGuaranteeDestReport_Column_List">
STAT_ID, guarantee, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitGuaranteeDestReport" parameterType="com.nis.domain.restful.DjJitGuaranteeDestReport"
resultMap="DjJitGuaranteeDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitGuaranteeDestReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_GUARANTEE_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchGuarantee != null and searchGuarantee !=''">
AND guarantee = #{searchGuarantee}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitTagSrcReportMap" type="com.nis.domain.restful.DjJitTagSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitTagSrcReport_Column_List">
STAT_ID, tag, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitTagSrcReport" parameterType="com.nis.domain.restful.DjJitTagSrcReport"
resultMap="DjJitTagSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitTagSrcReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_TAG_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in (${searchTag})
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitTagDestReportMap" type="com.nis.domain.restful.DjJitTagDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitTagDestReport_Column_List">
STAT_ID, tag, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitTagDestReport" parameterType="com.nis.domain.restful.DjJitTagDestReport"
resultMap="DjJitTagDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitTagDestReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_TAG_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in (${searchTag})
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitIdSrcReportMap" type="com.nis.domain.restful.DjJitIdSrcReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="id" jdbcType="BIGINT" property="id" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitIdSrcReport_Column_List">
STAT_ID, id, REPORT_TIME, SRC_COUNTRY, SRC_PROVINCE,
SRC_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitIdSrcReport" parameterType="com.nis.domain.restful.DjJitIdSrcReport"
resultMap="DjJitIdSrcReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitIdSrcReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_ID_SRC_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchId != null and searchId !=''">
AND id = #{searchId}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjJitIdDestReportMap" type="com.nis.domain.restful.DjJitIdDestReport">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="id" jdbcType="BIGINT" property="id" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="nation" />
<result column="DEST_PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="DEST_CITY" jdbcType="VARCHAR" property="city" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="DjJitIdDestReport_Column_List">
STAT_ID, id, REPORT_TIME, DEST_COUNTRY,
DEST_PROVINCE,
DEST_CITY, SUM,
SERVICE
</sql>
<select id="findDjJitIdDestReport" parameterType="com.nis.domain.restful.DjJitIdDestReport"
resultMap="DjJitIdDestReportMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjJitIdDestReport_Column_List" />
</otherwise>
</choose>
from DJ_JIT_ID_DEST_REPORT
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchId != null and searchId !=''">
AND id = #{searchId}
</if>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjCkStatLogMap" type="com.nis.domain.restful.DjCkStatLog">
<id column="STAT_ID" jdbcType="BIGINT" property="statId" />
<result column="CONFIG_ID" jdbcType="BIGINT" property="configId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
<result column="GJ_CK_ID" jdbcType="BIGINT" property="gjCkId" />
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="CAP_TIME" jdbcType="TIMESTAMP" property="capTime" />
</resultMap>
<sql id="DjCkStatLog_Column_List">
STAT_ID, CONFIG_ID, SERVICE, GJ_CK_ID,SUM,CAP_TIME,active_sys
</sql>
<select id="findDjCkStatLog" parameterType="com.nis.domain.restful.DjCkStatLog"
resultMap="DjCkStatLogMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="DjCkStatLog_Column_List" />
</otherwise>
</choose>
from DJ_CK_STAT_LOG
<where>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
<if test="searchGjCkId != null and searchGjCkId !=''">
AND GJ_CK_ID = #{searchGjCkId}
</if>
<if test="searchCfgId != null and searchCfgId !=''">
AND CONFIG_ID = #{searchCfgId}
</if>
<if test="searchActiveSys != null and searchActiveSys !=''">
AND active_sys = #{searchActiveSys}
</if>
<if test="searchCapStartTime != null and searchCapStartTime !=''">
<![CDATA[AND CAP_TIME >= to_date(#{searchCapStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchCapEndTime != null and searchCapEndTime !=''">
<![CDATA[AND CAP_TIME < to_date(#{searchCapEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,32 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.DfReportEntity;
import com.nis.domain.restful.DjLwhhAttrReport;
import com.nis.domain.restful.DjLwhhTagReport;
import com.nis.domain.restful.DjSrcIpAttrReport;
import com.nis.domain.restful.DjSrcIpTagReport;
/**
*
* @ClassName: DjMultiDimensionnalReportDao
* @Description: TODO(一句话描述这个类)
* @author (DDM)
* @date 2017年8月4日下午4:46:31
* @version V1.0
*/
@MyBatisDao
public interface DjMultiDimensionalReportDao extends CrudDao<DfReportEntity> {
List<DjLwhhAttrReport> findDjLwhhAttrReport(DjLwhhAttrReport pz);
List<DjLwhhTagReport> findDjLwhhTagReportPage(DjLwhhTagReport pz);
List<DjSrcIpAttrReport> findDjSrcIpAttrReportPage(DjSrcIpAttrReport pz);
List<DjSrcIpTagReport> findDjSrcIpTagReportPage(DjSrcIpTagReport pz);
}

View File

@@ -1,230 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DjMultiDimensionalReportDao">
<!-- 所有实时统计report表的公共属性 -->
<sql id="commonPorperty">
ASUM,BSUM,REPORT_TIME,SERVICE
</sql>
<resultMap id="DjLwhhAttrReportMap" type="com.nis.domain.restful.DjLwhhAttrReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="LWHH" jdbcType="BIGINT" property="lwhh" />
<result column="ATTR_TYPE" jdbcType="BIGINT" property="attrType" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDjLwhhAttrReport" parameterType="com.nis.domain.restful.DjLwhhAttrReport"
resultMap="DjLwhhAttrReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,LWHH,ATTR_TYPE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.LWHH,
pz.ATTR_TYPE
FROM DJ_LWHH_TYPE_REPORT PZ
GROUP BY PZ.LWHH,PZ.ATTR_TYPE, PZ.SERVICE, PZ.REPORT_TIME
) DJ_LWHH_TYPE_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjLwhhTagReportMap" type="com.nis.domain.restful.DjLwhhTagReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="LWHH" jdbcType="BIGINT" property="lwhh" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDjLwhhTagReportPage" parameterType="com.nis.domain.restful.DjLwhhTagReport"
resultMap="DjLwhhTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,LWHH,TAG
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.LWHH,
pz.TAG
FROM DJ_LWHH_TAG_REPORT PZ
GROUP BY PZ.LWHH,PZ.TAG, PZ.SERVICE, PZ.REPORT_TIME
) DJ_LWHH_TAG_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG in (${searchTag})
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpTagReportMap" type="com.nis.domain.restful.DjSrcIpTagReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDjSrcIpTagReportPage" parameterType="com.nis.domain.restful.DjSrcIpTagReport"
resultMap="DjSrcIpTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,SRC_PROVINCE,TAG
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.SRC_PROVINCE,
pz.TAG
FROM DJ_SRCIP_DOMESTIC_TAG_REPORT PZ
GROUP BY PZ.SRC_PROVINCE,PZ.TAG, PZ.SERVICE, PZ.REPORT_TIME
) DJ_SRCIP_DOMESTIC_TAG_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG in (${searchTag})
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpAttrReportMap" type="com.nis.domain.restful.DjSrcIpAttrReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="ATTR_TYPE" jdbcType="BIGINT" property="attrType" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
</resultMap>
<select id="findDjSrcIpAttrReportPage" parameterType="com.nis.domain.restful.DjSrcIpAttrReport"
resultMap="DjSrcIpAttrReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty" />,SRC_PROVINCE,ATTR_TYPE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.SRC_PROVINCE,
pz.ATTR_TYPE
FROM DJ_SRCIP_DOMESTIC_TYPE_REPORT PZ
GROUP BY PZ.SRC_PROVINCE,PZ.ATTR_TYPE, PZ.SERVICE, PZ.REPORT_TIME
) DJ_SRCIP_DOMESTIC_TYPE_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,40 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DjLwhhAttrDaily;
import com.nis.domain.restful.DjLwhhAttrMonth;
import com.nis.domain.restful.DjLwhhTagDaily;
import com.nis.domain.restful.DjLwhhTagMonth;
import com.nis.domain.restful.DjSrcIpAttrDaily;
import com.nis.domain.restful.DjSrcIpAttrMonth;
import com.nis.domain.restful.DjSrcIpTagDaily;
import com.nis.domain.restful.DjSrcIpTagMonth;
/**
*
* @ClassName: DjMultiDimensionnalReportDao
* @Description: TODO(一句话描述这个类)
* @author (DDM)
* @date 2017年8月4日下午4:46:31
* @version V1.0
*/
@MyBatisDao
public interface DjMultiDimensionalStatLogDao extends CrudDao<LogEntity> {
List<DjLwhhAttrDaily> djLwhhAttrDaily(DjLwhhAttrDaily pz);
List<DjLwhhAttrMonth> djLwhhAttrMonth(DjLwhhAttrMonth pz);
List<DjLwhhTagDaily> djLwhhTagDaily(DjLwhhTagDaily pz);
List<DjLwhhTagMonth> djLwhhTagMonth(DjLwhhTagMonth pz);
List<DjSrcIpAttrDaily> djSrcIpAttrDaily(DjSrcIpAttrDaily pz);
List<DjSrcIpAttrMonth> djSrcIpAttrMonth(DjSrcIpAttrMonth pz);
List<DjSrcIpTagDaily> djSrcIpTagDaily(DjSrcIpTagDaily pz);
List<DjSrcIpTagMonth> djSrcIpTagMonth(DjSrcIpTagMonth pz);
}

View File

@@ -1,475 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DjMultiDimensionalStatLogDao">
<!-- 配置报表的公共属性 -->
<sql id="commonPorperty">
ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjLwhhAttrDailyMap" type="com.nis.domain.restful.DjLwhhAttrDaily">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djLwhhAttrDaily" parameterType="com.nis.domain.restful.DjLwhhAttrDaily" resultMap="DjLwhhAttrDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select LWHH,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_LWHH_TYPE_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,ATTR_TYPE,service,stat_time
) DJ_LWHH_TYPE_STAT_LOG_DAILY
GROUP BY LWHH,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjLwhhAttrMonthMap" type="com.nis.domain.restful.DjLwhhAttrMonth">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djLwhhAttrMonth" parameterType="com.nis.domain.restful.DjLwhhAttrMonth" resultMap="DjLwhhAttrMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select LWHH,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_LWHH_TYPE_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,ATTR_TYPE,service,stat_time
) DJ_LWHH_TYPE_STAT_LOG_MONTH
GROUP BY LWHH,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjLwhhTagDailyMap" type="com.nis.domain.restful.DjLwhhTagDaily">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djLwhhTagDaily" parameterType="com.nis.domain.restful.DjLwhhTagDaily" resultMap="DjLwhhTagDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,TAG
</otherwise>
</choose>
FROM
(
select LWHH,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_LWHH_TAG_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,TAG,service,stat_time
) DJ_LWHH_TAG_STAT_LOG_DAILY
GROUP BY LWHH,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjLwhhTagMonthMap" type="com.nis.domain.restful.DjLwhhTagMonth">
<result column="lwhh" jdbcType="BIGINT" property="lwhh" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djLwhhTagMonth" parameterType="com.nis.domain.restful.DjLwhhTagMonth" resultMap="DjLwhhTagMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,LWHH,TAG
</otherwise>
</choose>
FROM
(
select LWHH,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select LWHH,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_LWHH_TAG_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND LWHH =#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by LWHH,TAG,service,stat_time
) DJ_LWHH_TAG_STAT_LOG_MONTH
GROUP BY LWHH,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpAttrDailyMap" type="com.nis.domain.restful.DjSrcIpAttrDaily">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djSrcIpAttrDaily" parameterType="com.nis.domain.restful.DjSrcIpAttrDaily" resultMap="DjSrcIpAttrDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_SRCIP_TYPE_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,ATTR_TYPE,service,stat_time
) DJ_SRCIP_TYPE_STAT_LOG_DAILY
GROUP BY SRC_PROVINCE,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpAttrMonthMap" type="com.nis.domain.restful.DjSrcIpAttrMonth">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="attr_type" jdbcType="BIGINT" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djSrcIpAttrMonth" parameterType="com.nis.domain.restful.DjSrcIpAttrMonth" resultMap="DjSrcIpAttrMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,ATTR_TYPE
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,ATTR_TYPE,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,ATTR_TYPE,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_SRCIP_TYPE_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,ATTR_TYPE,service,stat_time
) DJ_SRCIP_TYPE_STAT_LOG_MONTH
GROUP BY SRC_PROVINCE,ATTR_TYPE,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpTagDailyMap" type="com.nis.domain.restful.DjSrcIpTagDaily">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djSrcIpTagDaily" parameterType="com.nis.domain.restful.DjSrcIpTagDaily" resultMap="DjSrcIpTagDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,TAG
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_SRCIP_TAG_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,TAG,service,stat_time
) DJ_SRCIP_TAG_STAT_LOG_DAILY
GROUP BY SRC_PROVINCE,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpTagMonthMap" type="com.nis.domain.restful.DjSrcIpTagMonth">
<result column="src_province" jdbcType="VARCHAR" property="srcProvince" />
<result column="TAG" jdbcType="BIGINT" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<select id="djSrcIpTagMonth" parameterType="com.nis.domain.restful.DjSrcIpTagMonth" resultMap="DjSrcIpTagMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>,SRC_PROVINCE,TAG
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,TAG,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,TAG,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_SRCIP_TAG_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
AND TAG IN (${searchTag})
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,TAG,service,stat_time
) DJ_SRCIP_TAG_STAT_LOG_MONTH
GROUP BY SRC_PROVINCE,TAG,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,49 +0,0 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.DfReportEntity;
import com.nis.domain.restful.DjPzReportStat;
import com.nis.domain.restful.DjAttrTypeReport;
import com.nis.domain.restful.DjDestIpCountryReport;
import com.nis.domain.restful.DjEntranceReport;
import com.nis.domain.restful.DjLwhhReport;
import com.nis.domain.restful.DjSrcIpDomeSticReport;
import com.nis.domain.restful.DjTagReport;
import com.nis.domain.restful.DjPzReport;
/**
* @ClassName: DjReportDao
* @Description: TODO(一句话描述这个类)
* @author (ZBC)
* @date 2016年11月22日下午06:00:00
* @version V1.0
*/
@SuppressWarnings("rawtypes")
@MyBatisDao
public interface DjReportDao extends CrudDao<DfReportEntity> {
List<DjPzReport> findDjPzReport(DjPzReport entity);
List<DjPzReport> findDjPzPrivPage(DjPzReport entity);
List<DjPzReportStat> findDjPzReportStat(DjPzReportStat pz);
List<DjPzReportStat> findDjPzReportStatMinutes(DjPzReportStat pz);
// List<DjPzReport> findDjPzPrivPage(DjPzReport pz);
Long findDjPzReportSum(DjPzReportStat pz);
List<DjAttrTypeReport> findAttrTypeReport(DjAttrTypeReport pz);
List<DjSrcIpDomeSticReport> findSrcIpDomeSticReport(DjSrcIpDomeSticReport pz);
List<DjDestIpCountryReport> findDestIpCountryReport(DjDestIpCountryReport pz);
List<DjEntranceReport> findDjEntranceReport(DjEntranceReport pz);
List<DjLwhhReport> findDjLwhhReport(DjLwhhReport pz);
List<DjTagReport> findDjTagReportPage(DjTagReport pz);
}

View File

@@ -1,617 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DjReportDao">
<!-- 所有实时统计report表的公共属性 -->
<sql id="commonPorperty">
ASUM,BSUM,CSUM,REPORT_TIME
</sql>
<!-- DjPzReport日志查询 -->
<resultMap id="DjPzReportMap" type="com.nis.domain.restful.DjPzReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="CFG_ID" jdbcType="BIGINT" property="cfgId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<resultMap id="DjPzReportStatMap" type="com.nis.domain.restful.DjPzReportStat">
<result column="SUM" jdbcType="BIGINT" property="sum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="CFG_ID" jdbcType="BIGINT" property="configId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<!-- DJ_PZ_REPORT -->
<sql id="djPzReportPorperty">
,CFG_ID,SERVICE
</sql>
<select id="findDjPzReport" parameterType="com.nis.domain.restful.DjPzReport"
resultMap="DjPzReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,CSUM,REPORT_TIME,SERVICE,CFG_ID
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 1 THEN SUM ELSE 0 END) CSUM,
PZ.REPORT_TIME,
PZ.CFG_ID,
PZ.SERVICE
FROM DJ_PZ_REPORT PZ
GROUP BY PZ.CFG_ID,
PZ.SERVICE, PZ.REPORT_TIME
) DJ_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchCfgId != null and searchCfgId !=''">
AND CFG_ID =#{searchCfgId}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDjPzPrivPage" parameterType="com.nis.domain.restful.DjPzReport"
resultMap="DjPzReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,CFG_ID
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.CFG_ID,
PZ.SERVICE
FROM DJ_PZ_REPORT PZ
GROUP BY
PZ.CFG_ID, PZ.SERVICE, PZ.REPORT_TIME
) DJ_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchCfgId != null and searchCfgId !=''">
AND CFG_ID =#{searchCfgId}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDjPzReportStat" parameterType="com.nis.domain.restful.DjPzReportStat"
resultMap="DjPzReportStatMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
CFG_ID,SERVICE,SUM
</otherwise>
</choose>
FROM (
<choose>
<when test="searchStatActiveSys == 6 ">
SELECT CFG_ID,SERVICE, DECODE(ASUM,0,BSUM,ASUM) SUM FROM (
SELECT
config_id CFG_ID, SERVICE,
SUM(CASE WHEN ACTIVE_SYS=4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN ACTIVE_SYS=2 THEN SUM ELSE 0 END) BSUM
FROM dj_stat_log_hour
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND stat_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND stat_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
</where>
GROUP BY config_id,SERVICE
) REPORT
</when>
<otherwise>
SELECT
config_id CFG_ID,SERVICE,SUM(sum) SUM
FROM dj_stat_log_hour
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND stat_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND stat_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
AND active_sys=#{searchStatActiveSys}
</where>
GROUP BY config_id,SERVICE
</otherwise>
</choose>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDjPzReportStatMinutes" parameterType="com.nis.domain.restful.DjPzReportStat"
resultMap="DjPzReportStatMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
CFG_ID,SERVICE,SUM
</otherwise>
</choose>
FROM (
<choose>
<when test="searchStatActiveSys == 6 ">
SELECT CFG_ID,SERVICE, DECODE(ASUM,0,BSUM,ASUM) SUM FROM (
SELECT
CFG_ID, SERVICE,
SUM(CASE WHEN ACTIVE_SYS=4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN ACTIVE_SYS=2 THEN SUM ELSE 0 END) BSUM
FROM DJ_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
</where>
GROUP BY CFG_ID,SERVICE
) REPORT
</when>
<otherwise>
SELECT
CFG_ID,SERVICE,SUM(sum) SUM
FROM DJ_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
AND active_sys=#{searchStatActiveSys}
</where>
GROUP BY CFG_ID,SERVICE
</otherwise>
</choose>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<select id="findDjPzReportSum" parameterType="com.nis.domain.restful.DjPzReportStat"
resultType="java.lang.Long">
SELECT
SUM(sum) SUM
FROM DJ_PZ_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null ">
AND SERVICE =#{searchService}
</if>
AND active_sys=#{searchStatActiveSys}
</where>
</select>
<resultMap id="DjAttrTypeReportMap" type="com.nis.domain.restful.DjAttrTypeReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="ABSUM" jdbcType="BIGINT" property="absum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="ATTR_TYPE" jdbcType="INTEGER" property="attrType" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<select id="findAttrTypeReport" parameterType="com.nis.domain.restful.DjAttrTypeReport"
resultMap="DjAttrTypeReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,absum,REPORT_TIME,ATTR_TYPE,SERVICE
</otherwise>
</choose>
FROM (
SELECT attr_type,REPORT_TIME, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select attr_type, asum, bsum, absum, REPORT_TIME,service
from (select attr_type,
REPORT_TIME,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.REPORT_TIME,
pz.cfg_id,
pz.attr_type,pz.service
FROM dj_pz_attr_report PZ
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchAttrType != null and searchAttrType !=''">
AND ATTR_TYPE =#{searchAttrType}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
GROUP BY pz.cfg_id, pz.attr_type, PZ.REPORT_TIME,pz.service)) a)
group by attr_type, REPORT_TIME,service
) DJ_CFG_ATTR_STAT_LOG_HOUR
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpDomeSticReportMap" type="com.nis.domain.restful.DjSrcIpDomeSticReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
</resultMap>
<select id="findSrcIpDomeSticReport" parameterType="com.nis.domain.restful.DjSrcIpDomeSticReport"
resultMap="DjSrcIpDomeSticReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,SRC_PROVINCE,SRC_CITY
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.SRC_PROVINCE,pz.SRC_CITY
FROM
DJ_SRCIP_DOMESTIC_REPORT PZ
GROUP BY PZ.SRC_PROVINCE,pz.SRC_CITY,
PZ.SERVICE, PZ.REPORT_TIME
) DJ_SRCIP_DOMESTIC_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchSrcProvince != null and searchSrcProvince !=''">
AND SRC_PROVINCE =#{searchSrcProvince}
</if>
<if test="searchSrcCity != null and searchSrcCity !=''">
AND SRC_CITY =#{searchSrcCity}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjDestIpCountryReportMap" type="com.nis.domain.restful.DjDestIpCountryReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<select id="findDestIpCountryReport" parameterType="com.nis.domain.restful.DjDestIpCountryReport"
resultMap="DjDestIpCountryReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,DEST_COUNTRY,SERVICE
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.SERVICE,
pz.DEST_COUNTRY
FROM DJ_DESTIP_COUNTRY_REPORT
PZ
GROUP BY PZ.DEST_COUNTRY, PZ.SERVICE, PZ.REPORT_TIME
)
DJ_DESTIP_COUNTRY_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchDestCountry != null and searchDestCountry !=''">
AND DEST_COUNTRY =#{searchDestCountry}
</if>
<if test="searchService != null and searchService !=''">
AND SERVICE =#{searchService}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjLwhhReportMap" type="com.nis.domain.restful.DjLwhhReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="lwhh" jdbcType="INTEGER" property="lwhh" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<select id="findDjLwhhReport" parameterType="com.nis.domain.restful.DjLwhhReport"
resultMap="DjLwhhReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,LWHH
</otherwise>
</choose>
FROM (SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME,
PZ.lwhh,pz.service
FROM DJ_LWHH_REPORT PZ
GROUP BY
PZ.lwhh,pz.service, PZ.REPORT_TIME
)
DJ_LWHH_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
AND lwhh=#{searchLwhh}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- DjTagReport日志查询 -->
<resultMap id="DjTagReportMap" type="com.nis.domain.restful.DjTagReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="ABSUM" jdbcType="BIGINT" property="absum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="TAG" jdbcType="INTEGER" property="tag" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<sql id="djTagReportPorperty">
,tag
</sql>
<select id="findDjTagReportPage" parameterType="com.nis.domain.restful.DjTagReport"
resultMap="DjTagReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,absum,REPORT_TIME,SERVICE,TAG
</otherwise>
</choose>
FROM (
SELECT tag,REPORT_TIME, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, REPORT_TIME,service
from (select tag,
REPORT_TIME,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.REPORT_TIME,
pz.cfg_id,
pz.tag,pz.service
FROM dj_pz_tag_report PZ
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchTag != null and searchTag !=''">
AND tag in(${searchTag})
</if>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
</where>
GROUP BY pz.cfg_id, pz.tag, PZ.REPORT_TIME,pz.service)) a)
group by tag, REPORT_TIME,service
)
DJ_CFG_TAG_STAT_LOG_HOUR
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjEntranceReportMap" type="com.nis.domain.restful.DjEntranceReport">
<result column="ASUM" jdbcType="BIGINT" property="asum" />
<result column="BSUM" jdbcType="BIGINT" property="bsum" />
<result column="REPORT_TIME" jdbcType="TIMESTAMP" property="reportTime" />
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entraceId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
</resultMap>
<select id="findDjEntranceReport" parameterType="com.nis.domain.restful.DjEntranceReport"
resultMap="DjEntranceReportMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
ASUM,BSUM,REPORT_TIME,SERVICE,ENTRANCE_ID
</otherwise>
</choose>
FROM ( SELECT
SUM(CASE WHEN PZ.ACTIVE_SYS = 4 THEN SUM ELSE 0 END) ASUM,
SUM(CASE WHEN PZ.ACTIVE_SYS = 2 THEN SUM ELSE 0 END) BSUM,
PZ.REPORT_TIME REPORT_TIME,
PZ.ENTRANCE_ID ENTRANCE_ID,
pz.service
FROM DJ_ENTRANCE_REPORT PZ
GROUP BY
PZ.REPORT_TIME,pz.service, PZ.ENTRANCE_ID
)
DJ_ENTRANCE_REPORT
<where>
<if test="searchReportStartTime != null and searchReportStartTime !=''">
<![CDATA[AND REPORT_TIME >= to_date(#{searchReportStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchReportEndTime != null and searchReportEndTime !=''">
<![CDATA[AND REPORT_TIME < to_date(#{searchReportEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchService != null and searchService !=''">
AND service=#{searchService}
</if>
<if test="searchEntraceId != null and searchEntraceId !=''">
AND ENTRANCE_ID=#{searchEntraceId}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,54 +0,0 @@
/**
* @Title: DjStatLogDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author ddm
* @date 2016年9月13日 上午11:21:31
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DjAttrStatLogDaily;
import com.nis.domain.restful.DjAttrStatLogMonth;
import com.nis.domain.restful.DjDestIpCounrtyStatLogDaily;
import com.nis.domain.restful.DjDestIpCounrtyStatLogMonth;
import com.nis.domain.restful.DjEntrStatLogDaily;
import com.nis.domain.restful.DjEntrStatLogMonth;
import com.nis.domain.restful.DjLwhhStatLogDaily;
import com.nis.domain.restful.DjLwhhStatLogMonth;
import com.nis.domain.restful.DjSrcIpDomesticStatLogDaily;
import com.nis.domain.restful.DjSrcIpDomesticStatLogMonth;
import com.nis.domain.restful.DjStatLogDaily;
import com.nis.domain.restful.DjStatLogMonth;
import com.nis.domain.restful.DjTagStatLogDaily;
import com.nis.domain.restful.DjTagStatLogMonth;
/**
* @ClassName: DjStatLogDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ddm)
* @date 2016年9月13日 上午11:21:31
* @version V1.0
*/
@MyBatisDao
public interface DjStatLogDao extends CrudDao<LogEntity> {
List<DjStatLogDaily> djStatLogDaily(DjStatLogDaily daily);
List<DjStatLogMonth> djStatLogMonth(DjStatLogMonth mongth);
List<DjTagStatLogDaily> djTagStatLogDaily(DjTagStatLogDaily daily);
List<DjTagStatLogMonth> djTagStatLogMonth(DjTagStatLogMonth mongth);
List<DjAttrStatLogDaily> djAttrStatLogDaily(DjAttrStatLogDaily daily);
List<DjAttrStatLogMonth> djAttrStatLogMonth(DjAttrStatLogMonth mongth);
List<DjEntrStatLogDaily> djEntrStatLogDaily(DjEntrStatLogDaily daily);
List<DjEntrStatLogMonth> djEntrStatLogMonth(DjEntrStatLogMonth mongth);
List<DjLwhhStatLogDaily> djLwhhStatLogDaily(DjLwhhStatLogDaily daily);
List<DjLwhhStatLogMonth> djLwhhStatLogMonth(DjLwhhStatLogMonth mongth);
List<DjSrcIpDomesticStatLogDaily> djSrcIpDomesticStatLogDaily(DjSrcIpDomesticStatLogDaily daily);
List<DjSrcIpDomesticStatLogMonth> djSrcIpDomesticStatLogMonth(DjSrcIpDomesticStatLogMonth mongth);
List<DjDestIpCounrtyStatLogDaily> djDestIpCounrtyStatLogDaily(DjDestIpCounrtyStatLogDaily daily);
List<DjDestIpCounrtyStatLogMonth> djDestIpCounrtyStatLogMonth(DjDestIpCounrtyStatLogMonth mongth);
}

View File

@@ -1,858 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nis.web.dao.DjStatLogDao">
<!-- 配置报表的公共属性 -->
<sql id="commonPorperty">
CONFIG_ID,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjStatLogDailyMap" type="com.nis.domain.restful.DjStatLogDaily">
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_StatLog_Daily日志查询 -->
<select id="djStatLogDaily" parameterType="com.nis.domain.restful.DjStatLogDaily" resultMap="DjStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>
</otherwise>
</choose>
FROM
(
select config_id,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select config_id,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
and config_id=#{searchConfigId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by config_id,service,stat_time
) A
GROUP BY config_id,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjStatLogMonthMap" type="com.nis.domain.restful.DjStatLogMonth">
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_Stat_Log_Month日志查询 -->
<select id="djStatLogMonth" parameterType="com.nis.domain.restful.DjStatLogMonth" resultMap="DjStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="commonPorperty"/>
</otherwise>
</choose>
FROM
(
select config_id,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select config_id,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchConfigId != null and searchConfigId !=''">
and config_id=#{searchConfigId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by config_id,service,stat_time
) A
GROUP BY config_id,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 标签报表的公共属性 -->
<sql id="tagCommonPorperty">
TAG,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjTagStatLogDailyMap" type="com.nis.domain.restful.DjTagStatLogDaily">
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_TAG_Stat_Log_Daily日志查询 -->
<select id="djTagStatLogDaily" parameterType="com.nis.domain.restful.DjTagStatLogDaily" resultMap="DjTagStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="tagCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT tag,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, stat_time,service
from (select tag,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.tag,pz.service
FROM dj_cfg_tag_stat_log_daily PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
and tag=#{searchTag}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.tag, PZ.stat_time,pz.service)) a)
group by tag, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjTagStatLogMonthMap" type="com.nis.domain.restful.DjTagStatLogMonth">
<result column="tag" jdbcType="INTEGER" property="tag" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_Tag_Stat_Log_Month日志查询 -->
<select id="djTagStatLogMonth" parameterType="com.nis.domain.restful.DjTagStatLogMonth" resultMap="DjTagStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="tagCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT tag,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select tag, asum, bsum, absum, stat_time,service
from (select tag,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.tag,pz.service
FROM dj_cfg_tag_stat_log_month PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchTag != null and searchTag !=''">
and tag=#{searchTag}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.tag, PZ.stat_time,pz.service)) a)
group by tag, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 性质报表的公共属性 -->
<sql id="attrCommonPorperty">
attr_type,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjAttrStatLogDailyMap" type="com.nis.domain.restful.DjAttrStatLogDaily">
<result column="attr_type" jdbcType="INTEGER" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_ATTR_Stat_Log_Daily日志查询 -->
<select id="djAttrStatLogDaily" parameterType="com.nis.domain.restful.DjAttrStatLogDaily" resultMap="DjAttrStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="attrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT attr_type,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select attr_type, asum, bsum, absum, stat_time,service
from (select attr_type,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.attr_type,pz.service
FROM dj_cfg_attr_stat_log_daily PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
and attr_type=#{searchAttrType}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.attr_type, PZ.stat_time,pz.service)) a)
group by attr_type, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjAttrStatLogMonthMap" type="com.nis.domain.restful.DjAttrStatLogMonth">
<result column="attr_type" jdbcType="INTEGER" property="attrType" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_Attr_Stat_Log_Month日志查询 -->
<select id="djAttrStatLogMonth" parameterType="com.nis.domain.restful.DjAttrStatLogMonth" resultMap="DjAttrStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="attrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
SELECT attr_type,'7' as active_sys,stat_time, sum(asum) asum, sum(bsum) bsum, SUM(absum) absum,service
FROM (select attr_type, asum, bsum, absum, stat_time,service
from (select attr_type,
stat_time,service,
asum,
bsum,
decode(asum, 0, bsum, asum) absum
from (SELECT SUM(CASE
WHEN PZ.ACTIVE_SYS = 4 THEN
SUM
ELSE
0
END) ASUM,
SUM(CASE
WHEN PZ.ACTIVE_SYS = 2 THEN
SUM
ELSE
0
END) BSUM,
PZ.stat_time,
pz.config_id,
pz.attr_type,pz.service
FROM dj_cfg_attr_stat_log_month PZ
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchAttrType != null and searchAttrType !=''">
and attr_type=#{searchAttrType}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
GROUP BY pz.config_id, pz.attr_type, PZ.stat_time,pz.service)) a)
group by attr_type, stat_time,service
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 局点报表的公共属性 -->
<sql id="entrCommonPorperty">
ENTRANCE_ID,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjEntrStatLogDailyMap" type="com.nis.domain.restful.DjEntrStatLogDaily">
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entranceId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_ATTR_Stat_Log_Daily日志查询 -->
<select id="djEntrStatLogDaily" parameterType="com.nis.domain.restful.DjEntrStatLogDaily" resultMap="DjEntrStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="entrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select ENTRANCE_ID,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select ENTRANCE_ID,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_entr_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchEntranceId != null and searchEntranceId !=''">
and ENTRANCE_ID=#{searchEntranceId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by ENTRANCE_ID,service,stat_time
) A
GROUP BY ENTRANCE_ID,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjEntrStatLogMonthMap" type="com.nis.domain.restful.DjEntrStatLogMonth">
<result column="ENTRANCE_ID" jdbcType="INTEGER" property="entranceId" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_Entr_Stat_Log_Month日志查询 -->
<select id="djEntrStatLogMonth" parameterType="com.nis.domain.restful.DjEntrStatLogMonth" resultMap="DjEntrStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="entrCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select ENTRANCE_ID,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select ENTRANCE_ID,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_entr_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchEntranceId != null and searchEntranceId !=''">
and ENTRANCE_ID=#{searchEntranceId}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by ENTRANCE_ID,service,stat_time
) A
GROUP BY ENTRANCE_ID,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 来问函号报表的公共属性 -->
<sql id="lwhhCommonPorperty">
lwhh,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjLwhhStatLogDailyMap" type="com.nis.domain.restful.DjLwhhStatLogDaily">
<result column="lwhh" jdbcType="INTEGER" property="lwhh" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_ATTR_Stat_Log_Daily日志查询 -->
<select id="djLwhhStatLogDaily" parameterType="com.nis.domain.restful.DjLwhhStatLogDaily" resultMap="DjLwhhStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="lwhhCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select lwhh,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select lwhh,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_lwhh_STAT_LOG_DAILY
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
and lwhh=#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by lwhh,service,stat_time
) A
GROUP BY lwhh,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjLwhhStatLogMonthMap" type="com.nis.domain.restful.DjLwhhStatLogMonth">
<result column="lwhh" jdbcType="INTEGER" property="lwhh" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_Lwhh_Stat_Log_Month日志查询 -->
<select id="djLwhhStatLogMonth" parameterType="com.nis.domain.restful.DjLwhhStatLogMonth" resultMap="DjLwhhStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="lwhhCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select lwhh,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select lwhh,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from DJ_lwhh_STAT_LOG_MONTH
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchLwhh != null and searchLwhh !=''">
and lwhh=#{searchLwhh}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by lwhh,service,stat_time
) A
GROUP BY lwhh,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 境内源ip报表的公共属性 -->
<sql id="srcIpCommonPorperty">
SRC_PROVINCE,SRC_CITY,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjSrcIpDomesticStatLogDailyMap" type="com.nis.domain.restful.DjSrcIpDomesticStatLogDaily">
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_SrcIp_Stat_Log_Daily日志查询 -->
<select id="djSrcIpDomesticStatLogDaily" parameterType="com.nis.domain.restful.DjSrcIpDomesticStatLogDaily" resultMap="DjSrcIpDomesticStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="srcIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,SRC_CITY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,SRC_CITY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from dj_SRCIP_stat_log_daily
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,SRC_CITY,service,stat_time
) A
GROUP BY SRC_PROVINCE,SRC_CITY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjSrcIpDomesticStatLogMonthMap" type="com.nis.domain.restful.DjSrcIpDomesticStatLogMonth">
<result column="SRC_PROVINCE" jdbcType="VARCHAR" property="srcProvince" />
<result column="SRC_CITY" jdbcType="VARCHAR" property="srcCity" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_SrcIpDomestic_Stat_Log_Month日志查询 -->
<select id="djSrcIpDomesticStatLogMonth" parameterType="com.nis.domain.restful.DjSrcIpDomesticStatLogMonth" resultMap="DjSrcIpDomesticStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="srcIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select SRC_PROVINCE,SRC_CITY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select SRC_PROVINCE,SRC_CITY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from dj_SRCIP_stat_log_month
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by SRC_PROVINCE,SRC_CITY,service,stat_time
) A
GROUP BY SRC_PROVINCE,SRC_CITY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<!-- 国家目的ip报表的公共属性 -->
<sql id="destIpCommonPorperty">
DEST_COUNTRY,ACTIVE_SYS,SERVICE,ASUM,BSUM,ABSUM,STAT_TIME
</sql>
<resultMap id="DjDestIpCounrtyStatLogDailyMap" type="com.nis.domain.restful.DjDestIpCounrtyStatLogDaily">
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_DestIp_Stat_Log_Daily日志查询 -->
<select id="djDestIpCounrtyStatLogDaily" parameterType="com.nis.domain.restful.DjDestIpCounrtyStatLogDaily" resultMap="DjDestIpCounrtyStatLogDailyMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="destIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select DEST_COUNTRY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select DEST_COUNTRY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from dj_DESTIP_stat_log_daily
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by DEST_COUNTRY,service,stat_time
) A
GROUP BY DEST_COUNTRY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
<resultMap id="DjDestIpCounrtyStatLogMonthMap" type="com.nis.domain.restful.DjDestIpCounrtyStatLogMonth">
<result column="DEST_COUNTRY" jdbcType="VARCHAR" property="destCountry" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="asum" jdbcType="BIGINT" property="asum" />
<result column="bsum" jdbcType="BIGINT" property="bsum" />
<result column="absum" jdbcType="BIGINT" property="absum" />
<result column="stat_time" jdbcType="DATE" property="statTime" />
</resultMap>
<!-- Dj_DestIp_Stat_Log_Month日志查询 -->
<select id="djDestIpCounrtyStatLogMonth" parameterType="com.nis.domain.restful.DjDestIpCounrtyStatLogMonth" resultMap="DjDestIpCounrtyStatLogMonthMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="destIpCommonPorperty"/>
</otherwise>
</choose>
FROM
(
select DEST_COUNTRY,active_sys,service,stat_time,asum,bsum,decode(asum,0,bsum,asum) as absum
from (select DEST_COUNTRY,'7' as active_sys,service,stat_time
,sum(case when active_sys=4 then sum else 0 end) asum
,sum(case when active_sys=2 then sum else 0 end) bsum
from dj_DESTIP_stat_log_Month
<where>
<if test="searchService != null and searchService !=''">
and service=#{searchService}
</if>
<if test="searchStatStartTime != null and searchStatStartTime !=''">
<![CDATA[AND stat_time >= to_date(#{searchStatStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStatEndTime != null and searchStatEndTime !=''">
<![CDATA[AND stat_time < to_date(#{searchStatEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
</where>
group by DEST_COUNTRY,service,stat_time
) A
GROUP BY DEST_COUNTRY,active_sys ,service,stat_time,asum,bsum
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>