上传代码
This commit is contained in:
475
src/main/java/com/nis/web/dao/DjMultiDimensionalStatLogDao.xml
Normal file
475
src/main/java/com/nis/web/dao/DjMultiDimensionalStatLogDao.xml
Normal file
@@ -0,0 +1,475 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user