上传代码

This commit is contained in:
zhangdongxu
2017-12-19 14:55:52 +08:00
commit 13acafd43d
4777 changed files with 898870 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
package com.nis.web.dao;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.ConfigCompile;
import com.nis.domain.restful.ConfigCompileTest;
import com.nis.domain.restful.ConfigState;
/**
*
* @ClassName: ConfigCompileDao
* @Description: TODO(编译配置dao)
* @author (rkg)
* @date 2016年9月6日下午8:45:58
* @version V1.0
*/
@MyBatisDao
public interface ConfigCompileDao {
/**
* 添加编译配置信息,并返回主键id
*
* @param configCompileDao
* 编译配置对象
* @return 主键id
*/
public Long saveConfigCompile(ConfigCompile configCompile);
/**
* 根据主键id修改编译配置信息
*
* @param configCompileDao
* 编译配置对象
*/
public void updateConfigCompile(ConfigCompile configCompile);
/**
* 根据compileId设置配置有效或无效
* @param configCompile
* @param valid
*/
public void setCompileInvalid(@Param("compileId")Long compileId,@Param("valid")Integer valid);
/**
* 根据主键compileId查询对应的ConfigCompile
*
* @param compileId
* @return
*/
public ConfigCompile queryConfigCompileById(Long compileId);
/**
* 根据tableName查询是否有对应的配置状态记录
*
* @param tableName
* @return
*/
public List<ConfigState> queryConfigStateByTN(@Param("tableName") String tableName);
/**
* 根据表名更新配置状态操作时间
*
* @param tableName
* @param opTime
*/
public void updateConfigState(@Param("tableName") String tableName, @Param("opTime") Date opTime);
/**
* 新增配置状态
*
* @param tableName
* @param opTime
*/
public void saveConfigState(@Param("tableName") String tableName, @Param("opTime") Date opTime);
/**
* 批量新增配置
*
* @param configCompileList
*/
public void saveCompileBatch(List<ConfigCompile> configCompileList);
/**
*
* 条件查询配置信息
*
* @param configCompile
* @return
*/
public List<ConfigCompileTest> queryAllCompile(@Param("searchEndTime") String searchEndTime,
@Param("searchStartTime") String searchStartTime, @Param("service") Long service,
@Param("compileId") Long compileId);
/**
* 根据主键compileId查询对应的ConfigCompile
*
* @param compileIdArr
* @return
*/
public List<ConfigCompileTest> queryConfigCompileByIdArr(@Param("compileIdArr") String compileIdArr);
public Long getCompileSeq();
public Long getGroupSeq();
public Long getRegionSeq();
}

View File

@@ -0,0 +1,338 @@
<?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.ConfigCompileDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.ConfigCompileTest">
<id column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
<result column="SERVICE" jdbcType="BIGINT" property="service" />
<result column="ACTION" jdbcType="INTEGER" property="action" />
<result column="CONT_TYPE" jdbcType="INTEGER" property="contType" />
<result column="ATTR_TYPE" jdbcType="INTEGER" property="attrType" />
<result column="CONT_LABEL" jdbcType="VARCHAR" property="contLabel" />
<result column="Task_id" jdbcType="INTEGER" property="taskId" />
<result column="Guarantee_ID" jdbcType="INTEGER" property="guaranteeId" />
<result column="AFFAIR_ID" jdbcType="INTEGER" property="affAirId" />
<result column="TOPIC_ID" jdbcType="INTEGER" property="topIcId" />
<result column="DO_BLACKLIST" jdbcType="BIGINT" property="doBlackList" />
<result column="DO_LOG" jdbcType="INTEGER" property="doLog" />
<result column="EFFECTIVE_RANGE" jdbcType="VARCHAR" property="effectiveRange" />
<result column="ACTIVE_SYS" jdbcType="INTEGER" property="activeSys" />
<result column="CONFIG_PERCENT" jdbcType="DOUBLE" property="configPercent" />
<result column="CONFIG_OPTION" jdbcType="DOUBLE" property="configOption" />
<result column="START_TIME" jdbcType="TIMESTAMP" property="startTime" />
<result column="END_TIME" jdbcType="TIMESTAMP" property="endTime" />
<result column="USER_REGION" jdbcType="VARCHAR" property="userRegion" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="GROUP_NUM" jdbcType="INTEGER" property="groupNum" />
<result column="FATHER_CFG_ID" jdbcType="BIGINT" property="fatherCfgId" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
</resultMap>
<sql id="configCompileSql">
COMPILE_ID,SERVICE,ACTION,CONT_TYPE,ATTR_TYPE,CONT_LABEL,Task_id,Guarantee_ID,
AFFAIR_ID,TOPIC_ID,DO_BLACKLIST,DO_LOG,EFFECTIVE_RANGE,ACTIVE_SYS,
CONFIG_PERCENT,CONFIG_OPTION,START_TIME,END_TIME,USER_REGION,
IS_VALID,GROUP_NUM,FATHER_CFG_ID,OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<select id="queryConfigCompileById" parameterType="java.lang.Long"
resultMap="BaseResultMap">
select
<include refid="configCompileSql" />
from CONFIG_COMPILE where COMPILE_ID = #{compileId ,jdbcType=BIGINT }
</select>
<select id="queryConfigCompileByIdArr" parameterType="java.lang.String"
resultMap="BaseResultMap">
select
<include refid="configCompileSql" />
from CONFIG_COMPILE where COMPILE_ID in (${compileIdArr})
</select>
<select id="queryAllCompile" resultMap="BaseResultMap"
parameterType="com.nis.domain.restful.ConfigCompileTest">
select
<include refid="configCompileSql" />
from CONFIG_COMPILE
<where>
<if test="searchEndTime != null and searchEndTime!=''">
<![CDATA[AND OP_TIME < to_date(#{searchEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchStartTime != null and searchStartTime!=''">
<![CDATA[AND OP_TIME >= to_date(#{searchStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="service != null">
AND SERVICE = #{service}
</if>
<if test="compileId != null ">
AND COMPILE_ID = #{compileId}
</if>
</where>
order by OP_TIME
</select>
<select id="getCompileSeq" resultType="java.lang.Long">
select
SEQ_COMPILEID.NEXTVAL from dual;
</select>
<select id="getGroupSeq" resultType="java.lang.Long">
select SEQ_GROUPID.NEXTVAL
from dual;
</select>
<select id="getRegionSeq" resultType="java.lang.Long">
select SEQ_REGIONID.NEXTVAL
from dual;
</select>
<insert id="saveCompileBatch" parameterType="java.util.List">
<!-- insert /*+append*/ into CONFIG_COMPILE (COMPILE_ID ,SERVICE ,ACTION
, -->
insert into CONFIG_COMPILE (COMPILE_ID ,SERVICE ,ACTION ,
CONT_TYPE,
ATTR_TYPE,
CONT_LABEL,
Task_id,
Guarantee_ID,
AFFAIR_ID,
TOPIC_ID,
DO_BLACKLIST ,DO_LOG ,EFFECTIVE_RANGE ,
ACTIVE_SYS,
CONFIG_PERCENT
,CONFIG_OPTION
,START_TIME ,END_TIME ,
USER_REGION,
IS_VALID,GROUP_NUM,FATHER_CFG_ID
,OP_TIME,LAST_UPDATE
<!-- ,PROC_SEQ -->
)
<foreach collection="list" item="item" index="index" open="("
close=")" separator="union">
select
#{item.compileId,jdbcType=BIGINT},
#{item.service,jdbcType=BIGINT},
#{item.action,jdbcType=INTEGER},
#{item.contType,jdbcType=INTEGER},
#{item.attrType,jdbcType=INTEGER},
#{item.contLabel,jdbcType=INTEGER},
#{item.taskId,jdbcType=INTEGER},
#{item.guaranteeId,jdbcType=INTEGER},
#{item.affAirId,jdbcType=INTEGER},
#{item.topIcId,jdbcType=INTEGER},
#{item.doBlackList,jdbcType=BIGINT},
#{item.doLog,jdbcType=INTEGER},
#{item.effectiveRange,jdbcType=VARCHAR},
#{item.activeSys,jdbcType=INTEGER},
#{item.configPercent,jdbcType=DOUBLE},
#{item.configOption,jdbcType=DOUBLE},
#{item.startTime,jdbcType=TIMESTAMP},
#{item.endTime,jdbcType=TIMESTAMP},
#{item.userRegion,jdbcType=VARCHAR},
#{item.isValid,jdbcType=INTEGER},
#{item.groupNum,jdbcType=INTEGER },
#{item.fatherCfgId,jdbcType=BIGINT},
#{item.opTime,jdbcType=TIMESTAMP},
sysdate
<!-- ,#{item.procSeq,jdbcType=BIGINT} -->
from dual
</foreach>
</insert>
<insert id="saveConfigCompile" parameterType="com.nis.domain.restful.ConfigCompile">
<!-- <selectKey keyProperty="compileId" resultType="java.lang.Long" -->
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
<!-- select seq_compileId.nextval from dual -->
<!-- </selectKey> -->
insert into CONFIG_COMPILE (COMPILE_ID ,SERVICE ,ACTION ,
<if test="contType !=null">
CONT_TYPE,
</if>
<if test="attrType !=null">
ATTR_TYPE,
</if>
<if test="contLabel !=null and contLabel !=''">
CONT_LABEL,
</if>
<if test="taskId !=null">
Task_id,
</if>
<if test="guaranteeId !=null">
Guarantee_ID,
</if>
<if test="affAirId !=null">
AFFAIR_ID,
</if>
<if test="topIcId !=null">
TOPIC_ID,
</if>
<if test="lastUpdate !=null">
LAST_UPDATE,
</if>
DO_BLACKLIST ,DO_LOG ,EFFECTIVE_RANGE ,ACTIVE_SYS,
CONFIG_PERCENT
,CONFIG_OPTION
,START_TIME ,END_TIME ,
<if test="userRegion != null and userRegion !=''">
USER_REGION,
</if>
IS_VALID,GROUP_NUM,FATHER_CFG_ID ,OP_TIME) VALUES(
#{compileId,jdbcType=BIGINT},
#{service, jdbcType=BIGINT},
#{action,jdbcType=INTEGER},
<if test="contType !=null">
#{contType,jdbcType=INTEGER },
</if>
<if test="attrType !=null">
#{attrType,jdbcType=INTEGER },
</if>
<if test="contLabel !=null and contLabel !=''">
#{contLabel,jdbcType=INTEGER},
</if>
<if test="taskId !=null">
#{taskId,jdbcType=INTEGER},
</if>
<if test="guaranteeId !=null">
#{guaranteeId,jdbcType=INTEGER},
</if>
<if test="affAirId !=null">
#{affAirId,jdbcType=INTEGER},
</if>
<if test="topIcId !=null">
#{topIcId,jdbcType=INTEGER},
</if>
<if test="lastUpdate !=null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
#{doBlackList,jdbcType=BIGINT},
#{doLog,jdbcType=INTEGER},
#{effectiveRange,jdbcType=VARCHAR},
#{activeSys,jdbcType=INTEGER},
#{configPercent,jdbcType=DOUBLE},
#{configOption,jdbcType=DOUBLE},
#{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP},
<if test="userRegion != null and userRegion !=''">
#{userRegion,jdbcType=VARCHAR},
</if>
#{isValid,jdbcType=INTEGER},
#{groupNum,jdbcType=INTEGER },
#{fatherCfgId,jdbcType=BIGINT},
#{opTime,jdbcType=TIMESTAMP})
</insert>
<update id="updateConfigCompile" parameterType="com.nis.domain.restful.ConfigCompile">
update CONFIG_COMPILE
<set>
LAST_UPDATE =sysdate,
<if test="contType != null">
CONT_TYPE = #{contType,jdbcType=INTEGER},
</if>
<if test="attrType != null">
ATTR_TYPE = #{attrType,jdbcType=INTEGER},
</if>
<if test="contLabel != null and contLabel!=''">
CONT_LABEL = #{contLabel,jdbcType=VARCHAR},
</if>
<if test="taskId != null">
Task_id = #{taskId,jdbcType=INTEGER},
</if>
<if test="guaranteeId != null">
Guarantee_ID = #{guaranteeId,jdbcType=INTEGER},
</if>
<if test="affAirId != null">
AFFAIR_ID = #{affAirId,jdbcType=INTEGER},
</if>
<if test="topIcId != null">
TOPIC_ID = #{topIcId,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="activeSys != null">
ACTIVE_SYS = #{activeSys,jdbcType=INTEGER},
</if>
<if test="effectiveRange != null and effectiveRange!=''">
EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},
</if>
</set>
where COMPILE_ID = #{compileId ,jdbcType=BIGINT }
</update>
<update id="setCompileInvalid" >
update CONFIG_COMPILE set is_valid=#{valid,jdbcType=INTEGER } where COMPILE_ID = #{compileId ,jdbcType=BIGINT }
</update>
<!-- <update id="updateConfigCompile" parameterType="com.nis.domain.restful.ConfigCompile">
update CONFIG_COMPILE <set> <if test="service != null"> SERVICE = #{service,jdbcType=BIGINT},
</if> <if test="action != null"> ACTION = #{action,jdbcType=BIGINT}, </if>
<if test="contType != null"> CONT_TYPE =#{contType,jdbcType=INTEGER }, </if>
<if test="attrType != null"> ATTR_TYPE =#{attrType,jdbcType=INTEGER }, </if>
<if test="contLabel != null"> CONT_LABEL = #{contLabel,jdbcType=INTEGER },
</if> <if test="taskId != null"> Task_id = #{taskId,jdbcType=INTEGER }, </if>
<if test="guaranteeId != null"> Guarantee_ID=#{guaranteeId,jdbcType=INTEGER
}, </if> <if test="affAirId != null"> AFFAIR_ID = #{ affAirId , jdbcType=INTEGER
}, </if> <if test="topIcId != null"> TOPIC_ID = #{ topIcId , jdbcType=INTEGER
}, </if> <if test="doBlackList != null"> DO_BLACKLIST = #{doBlackList,jdbcType=BIGINT},
</if> <if test="doLog != null"> DO_LOG = #{doLog,jdbcType=INTEGER}, </if>
<if test="effectiveRange != null"> EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},
</if> <if test="configPercent != null"> CONFIG_PERCENT = #{configPercent,jdbcType=DOUBLE},
</if> <if test="configOption != null"> CONFIG_OPTION = #{configOption,jdbcType=DOUBLE},
</if> <if test="startTime != null"> START_TIME = #{startTime,jdbcType=TIMESTAMP},
</if> <if test="endTime != null"> END_TIME = #{endTime,jdbcType=TIMESTAMP},
</if> <if test="userRegion != null and userRegion !=''"> USER_REGION = #{userRegion,jdbcType=VARCHAR},
</if> <if test="isValid != null"> IS_VALID = #{isValid,jdbcType=INTEGER},
</if> <if test="groupNum != null"> GROUP_NUM = #{groupNum,jdbcType=INTEGER},
</if> <if test="fatherCfgId != null"> FATHER_CFG_ID = #{fatherCfgId,jdbcType=BIGINT},
</if> <if test="opTime != null"> OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if> </set> where COMPILE_ID = #{compileId ,jdbcType=BIGINT } </update> -->
<resultMap id="ConfigStateResultMap" type="com.nis.domain.restful.ConfigState">
<result column="TABLE_NAME" jdbcType="VARCHAR" property="tableName" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<sql id="configStateSql">
TABLE_NAME,OP_TIME
</sql>
<select id="queryConfigStateByTN" parameterType="java.lang.String"
resultMap="ConfigStateResultMap">
select
<include refid="configStateSql" />
from CONFIG_STATE where TABLE_NAME = #{tableName ,jdbcType=VARCHAR}
</select>
<update id="updateConfigState" parameterType="map">
update CONFIG_STATE
<set>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where TABLE_NAME = #{tableName ,jdbcType=VARCHAR }
</update>
<insert id="saveConfigState" parameterType="map">
insert into
CONFIG_STATE(TABLE_NAME,OP_TIME)
values(#{tableName,jdbcType=VARCHAR},#{opTime,jdbcType=TIMESTAMP})
</insert>
</mapper>

View File

@@ -0,0 +1,53 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.restful.ConfigGroupRelation;
/**
*
* @ClassName: ConfigGroupRelationDao
* @Description: TODO(配置分组Dao)
* @author (rkg)
* @date 2016年9月6日下午8:49:21
* @version V1.0
*/
@MyBatisDao
public interface ConfigGroupRelationDao {
/**
* 添加配置分组信息,并返回主键
*
* @param record
* @return 主键
* @throws Exception
*/
public Long saveConfigGroupRelation(ConfigGroupRelation record) ;
/**
* 根据主键Id修改配置分组信息
*
* @param record
* @throws Exception
*/
public void updateConfigGroupRelation(ConfigGroupRelation record) ;
/**
* 根据compileId查询对应的配置分组信息
*
* @param compileId
* @return
*/
public List<ConfigGroupRelation> queryCompileGroupByPID(Long compileId);
/**
* 根据groupid查询是否有对应的有效的编译配置
* @param GROUP_ID
* @return
*/
public List<ConfigGroupRelation> queryCompileGroupByGID(Long GROUP_ID);
/**
* 批量新增表配置
* @param configGroupRelationList
*/
public void saveGroupBatch(List<ConfigGroupRelation> configGroupRelationList);
}

View File

@@ -0,0 +1,114 @@
<?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.ConfigGroupRelationDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.ConfigGroupRelation">
<result column="ID" jdbcType="BIGINT" property="id" />
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
<result column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
<result column="IS_VALID" jdbcType="BIGINT" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
</resultMap>
<sql id="compileGroupSql">
ID,GROUP_ID,COMPILE_ID,IS_VALID,OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<select id="queryCompileGroupByPID" parameterType="com.nis.domain.restful.ConfigGroupRelation"
resultMap="BaseResultMap">
select
<include refid="compileGroupSql" />
from CONFIG_GROUP where COMPILE_ID = #{compileId ,jdbcType=BIGINT }
</select>
<select id="queryCompileGroupByGID" parameterType="com.nis.domain.restful.ConfigGroupRelation"
resultMap="BaseResultMap">
select
<include refid="compileGroupSql" />
from CONFIG_GROUP where IS_VALID=1 GROUP_ID = #{groupId
,jdbcType=BIGINT }
</select>
<insert id="saveGroupBatch" parameterType="java.util.List">
<!-- insert /*+append*/ into CONFIG_GROUP -->
insert into CONFIG_GROUP
(ID,GROUP_ID, COMPILE_ID, IS_VALID,
OP_TIME,LAST_UPDATE
<!-- ,PROC_SEQ -->
)
<foreach collection="list" item="item" index="index" open="("
close=")" separator="union">
select
<!-- seq_groupId.nextval, -->
#{item.id,jdbcType=BIGINT},
#{item.groupId,jdbcType=BIGINT},
#{item.compileId,jdbcType=BIGINT},
#{item.isValid,jdbcType=BIGINT},
#{item.opTime,jdbcType=TIMESTAMP},
sysdate
<!-- ,#{item.procSeq,jdbcType=BIGINT} -->
from dual
</foreach>
</insert>
<insert id="saveConfigGroupRelation" parameterType="com.nis.domain.restful.ConfigGroupRelation">
<!-- <selectKey keyProperty="groupId" resultType="java.lang.Long" -->
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
<!-- select seq_groupId.nextval from dual -->
<!-- </selectKey> -->
insert into CONFIG_GROUP
(ID,GROUP_ID, COMPILE_ID, IS_VALID,
LAST_UPDATE,
OP_TIME )
values
(
<!-- #{id,jdbcType=BIGINT}, -->
seq_config_group.nextval,
#{groupId,jdbcType=BIGINT},
#{compileId,jdbcType=BIGINT},
#{isValid,jdbcType=BIGINT},
sysdate,
#{opTime,jdbcType=TIMESTAMP}
)
</insert>
<update id="updateConfigGroupRelation" parameterType="com.nis.domain.restful.ConfigGroupRelation">
UPDATE
CONFIG_GROUP
<set>
<if test="isValid != null">
IS_VALID=#{isValid , jdbcType=BIGINT},
</if>
<if test="opTime != null">
OP_TIME=#{opTime , jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate , jdbcType=TIMESTAMP},
</if>
</set>
where GROUP_ID=#{groupId}
</update>
<!-- <update id="updateConfigGroupRelation" parameterType="com.nis.domain.restful.ConfigGroupRelation">
UPDATE CONFIG_GROUP <set> <if test="compileId != null"> COMPILE_ID=#{compileId
, jdbcType=BIGINT}, </if> <if test="isValid != null"> IS_VALID=#{isValid
, jdbcType=BIGINT}, </if> <if test="opTime != null"> OP_TIME=#{opTime , jdbcType=TIMESTAMP},
</if> </set> where GROUP_ID=#{groupId} </update> -->
</mapper>

View File

@@ -0,0 +1,19 @@
package com.nis.web.dao;
import java.io.Serializable;
import com.nis.domain.restful.ConfigPzIdSource;
/**
* @ClassName:ConfigPzIdDao
* @Description:TODO(这里用一句话描述这个类的作用)
* @author (zdx)
* @date 2017年9月20日 上午10:35:24
* @version V1.0
*/
@MyBatisDao
public interface ConfigPzIdDao extends CrudDao<Serializable>{
Long getConfigPzIdList(ConfigPzIdSource entity);
}

View File

@@ -0,0 +1,21 @@
<?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.ConfigPzIdDao">
<select id="getConfigPzIdList" parameterType="com.nis.domain.restful.ConfigPzIdSource" resultType="java.lang.Long" useCache="false" flushCache="true">
SELECT
<if test="sourceName != null and sourceName =='CONFIG_COMPILE'">
SEQ_COMPILEID.nextval
</if>
<if test="sourceName != null and sourceName =='CONFIG_GROUP_ID'">
SEQ_CONFIG_GROUP.nextval
</if>
<if test="sourceName != null and sourceName =='CONFIG_GROUP'">
SEQ_GROUPID.nextval
</if>
<if test="sourceName != null and sourceName =='CONFIG_REGION'">
SEQ_REGIONID.nextval
</if>
FROM dual
</select>
</mapper>

View File

@@ -0,0 +1,31 @@
/**
* @Title: ControlLogDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author darnell
* @date 2016年8月15日 下午4:13:49
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.ControlLog;
/**
* @ClassName: ControlLogDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (darnell)
* @date 2016年8月15日 下午4:13:49
* @version V1.0
*/
@MyBatisDao
public interface ControlLogDao extends CrudDao<ControlLog> {
List<ControlLog> getLogInfo(ControlLog controlLog);
void saveControlLog(ControlLog controlLog);
void removeControlLog(long id);
}

View File

@@ -0,0 +1,99 @@
<?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.ControlLogDao" >
<select id="getLogInfo" resultType="controlLog">
SELECT
l.*
FROM log_info l
</select>
<resultMap type="controlLog" id="controlLogMap">
<id property="id" column="id"/>
<result property="domain" column="domain"/>
<result property="title" column="title"/>
<result property="srcIp" column="source_ip"/>
<result property="resIp" column="res_ip"/>
<result property="optTime" column="opt_time"/>
<result property="status" column="status"/>
</resultMap>
<sql id="controlLogColumns">
id,
domain,
title,
source_ip,
res_ip,
status,
opt_time
</sql>
<select id="get" resultMap="controlLogMap">
select
<include refid="controlLogColumns"/>
from log_info
WHERE id=#{id}
</select>
<select id="findList" resultMap="controlLogMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="controlLogColumns"/>
</otherwise>
</choose>
from log_info
WHERE 1=1
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY id desc
</otherwise>
</choose>
</select>
<insert id="saveControlLog" parameterType="controlLog" >
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_LOG_INFO.Nextval as ID from DUAL
</selectKey>
insert into LOG_INFO(ID,DOMAIN,TITLE,SOURCE_IP,RES_IP,STATUS,OPT_TIME)
values (#{id},#{domain},#{title},#{srcIp},#{resIp},#{status},#{optTime})
</insert>
<update id="removeControlLog">
UPDATE LOG_INFO SET
status = 0
WHERE id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,65 @@
package com.nis.web.dao;
import java.util.List;
/**
* DAO支持类实现
* @author
* @version
* @param <T>
*/
public interface CrudDao<T> {
/**
* 获取单条数据
* @param id
* @return
*/
public T get(Long id);
/**
* 获取单条数据
* @param entity
* @return
*/
public T get(T entity);
/**
* 查询数据列表如果需要分页请设置分页对象entity.setPage(new Page<T>());
* @param entity
* @return
*/
public List<T> findList(T entity);
/**
* 查询所有数据列表
* @param entity
* @return
*/
public List<T> findAllList(T entity);
/**
* 插入数据
* @param entity
* @return
*/
public int insert(T entity);
/**
* 更新数据
* @param entity
* @return
*/
public int update(T entity);
public int updateValid(T entity);
/**
* 删除数据一般为逻辑删除更新del_flag字段为1
* @param entity
* @return
*/
public int delete(T entity);
}

View File

@@ -0,0 +1,49 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.restful.DataDictionaryName;
import com.nis.domain.restful.DataDictionaryValue;
@MyBatisDao
public interface DataDictionaryDao {
/**
* 获取所有有效的数据字典
*
* @return
*/
public List<DataDictionaryValue> getAllDictName(DataDictionaryValue dataDictionaryValue);
/**
* 获取所有有效的数据字典
* @return
*/
public List<DataDictionaryName> selAllDictName();
/**
* 新增数据字典名称并返回数据字典名称
*
* @param dataDictionaryName
* @return
*/
public Long addDictName(DataDictionaryName dataDictionaryName);
/**
* 新增数据字典值
*
* @param dataDictionaryValue
*/
public void addDictValue(DataDictionaryValue dataDictionaryValue);
/**
* 修改数据字典名称或将该数据字典置为无效
*
* @param dataDictionaryName
*/
public void updateDictName(DataDictionaryName dataDictionaryName);
/**
* 修改数据字典值
*
* @param dataDictionaryValue
*/
public void updateDictValue(DataDictionaryValue dataDictionaryValue);
}

View File

@@ -0,0 +1,112 @@
<?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.DataDictionaryDao">
<resultMap id="DataDictionaryMap" type="com.nis.domain.restful.DataDictionaryName">
<id column="dictnameid" jdbcType="BIGINT" property="dictNameId" />
<result column="datadictname" jdbcType="BIGINT" property="dataDictName" />
<collection property="dictValueList"
ofType="com.nis.domain.restful.DataDictionaryValue">
<id column="dictvalueid" jdbcType="BIGINT" property="dictValueId" />
<result column="dataDictValue" jdbcType="BIGINT" property="dataDictValue" />
</collection>
</resultMap>
<resultMap id="DataDictValMap" type="com.nis.domain.restful.DataDictionaryValue">
<id column="dictvalueid" jdbcType="BIGINT" property="dictValueId" />
<result column="dictNameId" jdbcType="BIGINT" property="dictNameId" />
<result column="datadictname" jdbcType="BIGINT" property="dataDictName" />
<result column="dataDictValue" jdbcType="BIGINT" property="dataDictValue" />
</resultMap>
<sql id="dataDictSql">
n.id dictnameid,
n.datadictname datadictname,
v.id
dictvalueid,
v.datadictvalue datadictvalue
</sql>
<select id="getAllDictName" resultMap="DataDictValMap">
select
<include refid="dataDictSql" />
from datadictionaryname n left join datadictionaryvalue v on n.id =
v.datadictid
<where>
n.isvalid = 1 and v.isvalid=1
<if test="dictValueId != null">
and v.id = #{dictValueId}
</if>
<if test="dictNameId != null">
and n.id = #{dictNameId}
</if>
<if test="dataDictValue != null and dataDictValue!=''">
and v.dataDictValue = #{dataDictValue}
</if>
<if test="dataDictName != null and dataDictName!=''">
and n.datadictname= #{dataDictName}
</if>
</where>
</select>
<select id="selAllDictName" resultMap="DataDictionaryMap">
select n.id dictnameid,
n.datadictname datadictname from datadictionaryname n where
n.isvalid=1
</select>
<insert id="addDictName" parameterType="com.nis.domain.restful.DataDictionaryName">
<selectKey keyProperty="dictNameId" resultType="java.lang.Long"
order="BEFORE">
select seq_datadict.nextval from dual
</selectKey>
insert into datadictionaryname (id ,datadictname,isValid) values(
#{dictNameId,jdbcType=BIGINT},
#{dataDictName, jdbcType=VARCHAR},1)
</insert>
<insert id="addDictValue" parameterType="com.nis.domain.restful.DataDictionaryValue">
<selectKey keyProperty="dictValueId" resultType="java.lang.Long"
order="BEFORE">
select seq_datadict.nextval from dual
</selectKey>
insert into datadictionaryvalue (id ,datadictid,datadictvalue,isValid)
values(
#{dictValueId,jdbcType=BIGINT},#{dictNameId, jdbcType=BIGINT},
#{dataDictValue,jdbcType=VARCHAR},1)
</insert>
<update id="updateDictName" parameterType="com.nis.domain.restful.DataDictionaryName">
update datadictionaryname
<set>
<if test="isValid != null">
isValid = #{isValid,jdbcType=BIGINT},
</if>
<if test="dataDictName != null">
dataDictName = #{dataDictName,jdbcType=VARCHAR},
</if>
</set>
where id = #{dictNameId ,jdbcType=BIGINT }
</update>
<update id="updateDictValue" parameterType="com.nis.domain.restful.DataDictionaryValue">
update datadictionaryvalue
<set>
<if test="dataDictValue != null and dataDictValue!=''">
dataDictValue = #{dataDictValue,jdbcType=VARCHAR},
</if>
<if test="isValid != null">
isValid = #{isValid,jdbcType=BIGINT},
</if>
</set>
where id = #{dictValueId ,jdbcType=BIGINT }
</update>
</mapper>

View File

@@ -0,0 +1,25 @@
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

@@ -0,0 +1,150 @@
<?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

@@ -0,0 +1,13 @@
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

@@ -0,0 +1,43 @@
<?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

@@ -0,0 +1,20 @@
package com.nis.web.dao;
import com.nis.domain.restful.DfIpPortUdp;
import com.nis.domain.restful.JdjInfo;
/**
* @ClassName: JdjInfoDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:02:33
* @version V1.0
*/
@MyBatisDao
public interface DfIpPortUdpDao extends CrudDao<DfIpPortUdp>{
int delete(long id);
int insert(DfIpPortUdp record);
int update(DfIpPortUdp record);
}

View File

@@ -0,0 +1,240 @@
<?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.DfIpPortUdpDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DfIpPortUdp">
<id column="CFG_ID" jdbcType="BIGINT" property="cfgId" />
<result column="ADDR_TYPE" jdbcType="INTEGER" property="addrType" />
<result column="SRC_IP" jdbcType="VARCHAR" property="srcIp" />
<result column="MASK_SRC_IP" jdbcType="VARCHAR" property="maskSrcIp" />
<result column="SRC_PORT" jdbcType="VARCHAR" property="srcPort" />
<result column="MASK_SRC_PORT" jdbcType="VARCHAR" property="maskSrcPort" />
<result column="DST_IP" jdbcType="VARCHAR" property="dstIp" />
<result column="MASK_DST_IP" jdbcType="VARCHAR" property="maskDstIp" />
<result column="DST_PORT" jdbcType="VARCHAR" property="dstPort" />
<result column="MASK_DST_PORT" jdbcType="VARCHAR" property="maskDstPort" />
<result column="PROTOCOL" jdbcType="INTEGER" property="protocol" />
<result column="DIRECTION" jdbcType="INTEGER" property="direction" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" column="LAST_UPDATE"/>
<result property="effectiveRange" column="EFFECTIVE_RANGE"/>
<result property="activeSys" column="ACTIVE_SYS"/>
</resultMap>
<sql id="Base_Column_List">
CFG_ID, ADDR_TYPE, SRC_IP, MASK_SRC_IP, SRC_PORT, MASK_SRC_PORT, DST_IP, MASK_DST_IP,
DST_PORT, MASK_DST_PORT, PROTOCOL, DIRECTION, IS_VALID, OP_TIME,lastUpdate,effectiveRange,activeSys
</sql>
<!--
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from DF_IP_PORT_UDP
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
-->
<delete id="delete" parameterType="java.lang.Long">
delete from DF_IP_PORT_UDP
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</delete>
<!--
<insert id="insert" parameterType="com.nis.domain.restful.DfIpPortUdp">
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DF_IP_PORT_UDP.Nextval as ID from DUAL
</selectKey>
insert into DF_IP_PORT_UDP (CFG_ID, ADDR_TYPE, SRC_IP,
MASK_SRC_IP, SRC_PORT, MASK_SRC_PORT,
DST_IP, MASK_DST_IP, DST_PORT,
MASK_DST_PORT, PROTOCOL, DIRECTION,
IS_VALID, OP_TIME)
values (#{id,jdbcType=BIGINT}, #{addrType,jdbcType=INTEGER}, #{srcIp,jdbcType=VARCHAR},
#{maskSrcIp,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR}, #{maskSrcPort,jdbcType=VARCHAR},
#{dstIp,jdbcType=VARCHAR}, #{maskDstIp,jdbcType=VARCHAR}, #{dstPort,jdbcType=VARCHAR},
#{maskDstPort,jdbcType=VARCHAR}, #{protocol,jdbcType=INTEGER}, #{direction,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER}, #{opTime,jdbcType=TIMESTAMP})
</insert>
-->
<insert id="insert" parameterType="com.nis.domain.restful.DfIpPortUdp">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="cfgId">
SELECT SEQ_DF_IP_PORT_UDP.Nextval as ID from DUAL
</selectKey>
-->
insert into DF_IP_PORT_UDP
<trim prefix="(" suffix=")" suffixOverrides=",">
CFG_ID,
<if test="addrType != null">
ADDR_TYPE,
</if>
<if test="srcIp != null">
SRC_IP,
</if>
<if test="maskSrcIp != null">
MASK_SRC_IP,
</if>
<if test="srcPort != null">
SRC_PORT,
</if>
<if test="maskSrcPort != null">
MASK_SRC_PORT,
</if>
<if test="dstIp != null">
DST_IP,
</if>
<if test="maskDstIp != null">
MASK_DST_IP,
</if>
<if test="dstPort != null">
DST_PORT,
</if>
<if test="maskDstPort != null">
MASK_DST_PORT,
</if>
<if test="protocol != null">
PROTOCOL,
</if>
<if test="direction != null">
DIRECTION,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="opTime != null">
LAST_UPDATE,
</if>
<if test="effectiveRange != null">
EFFECTIVE_RANGE,
</if>
<if test="activeSys != null">
ACTIVE_SYS,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{cfgId,jdbcType=BIGINT},
<if test="addrType != null">
#{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null">
#{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null">
#{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null">
#{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null">
#{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null">
#{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null">
#{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null">
#{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null">
#{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
#{direction,jdbcType=INTEGER},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="effectiveRange != null">
#{effectiveRange,jdbcType=VARCHAR},
</if>
<if test="activeSys != null">
#{activeSys,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="update" parameterType="com.nis.domain.restful.DfIpPortUdp">
update DF_IP_PORT_UDP
<set>
<if test="addrType != null">
ADDR_TYPE = #{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null">
SRC_IP = #{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null">
MASK_SRC_IP = #{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null">
SRC_PORT = #{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null">
MASK_SRC_PORT = #{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null">
DST_IP = #{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null">
MASK_DST_IP = #{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null">
DST_PORT = #{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null">
MASK_DST_PORT = #{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
PROTOCOL = #{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
DIRECTION = #{direction,jdbcType=INTEGER},
</if>
<if test="isValid != null">
IS_VALID = #{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="effectiveRange != null">
EFFECTIVE_RANGE=#{effectiveRange,jdbcType=VARCHAR},
</if>
<if test="activeSys != null">
ACTIVE_SYS=#{activeSys,jdbcType=INTEGER},
</if>
</set>
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DfIpPortUdp">
update DF_IP_PORT_UDP
set ADDR_TYPE = #{addrType,jdbcType=INTEGER},
SRC_IP = #{srcIp,jdbcType=VARCHAR},
MASK_SRC_IP = #{maskSrcIp,jdbcType=VARCHAR},
SRC_PORT = #{srcPort,jdbcType=VARCHAR},
MASK_SRC_PORT = #{maskSrcPort,jdbcType=VARCHAR},
DST_IP = #{dstIp,jdbcType=VARCHAR},
MASK_DST_IP = #{maskDstIp,jdbcType=VARCHAR},
DST_PORT = #{dstPort,jdbcType=VARCHAR},
MASK_DST_PORT = #{maskDstPort,jdbcType=VARCHAR},
PROTOCOL = #{protocol,jdbcType=INTEGER},
DIRECTION = #{direction,jdbcType=INTEGER},
IS_VALID = #{isValid,jdbcType=INTEGER},
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</update>
-->
</mapper>

View File

@@ -0,0 +1,45 @@
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

@@ -0,0 +1,692 @@
<?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

@@ -0,0 +1,28 @@
/**
* @Title: DfKeyConvertUrlDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author DDM
* @date 2016年9月27日下午9:59:58
* @version V1.0
*/
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.domain.restful.DjFlowControlStop;
/**
* @ClassName: DfKeyConvertUrlDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author DDM
* @date 2016年9月27日下午9:59:58
* @version V1.0
*/
@MyBatisDao
public interface DfKeyConvertUrlDao extends CrudDao<Serializable>{
List<DfKeyConvertUrl> findDfKeyConvertUrlPage(DfKeyConvertUrl entity);
}

View File

@@ -0,0 +1,44 @@
<?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.DfKeyConvertUrlDao">
<!-- DJ_FLOWCONTROL_STOP -->
<sql id="dfKeyConvertUrlProperty">
ID,KEY_ID,URL,OP_TIME
</sql>
<resultMap id="DfKeyConvertUrlMap" type="com.nis.domain.restful.DfKeyConvertUrl">
<result column="id" jdbcType="INTEGER" property="id" />
<result column="key_id" jdbcType="INTEGER" property="keyId" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<select id="findDfKeyConvertUrlPage" parameterType="com.nis.domain.restful.DfKeyConvertUrl" resultMap="DfKeyConvertUrlMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dfKeyConvertUrlProperty"/>
</otherwise>
</choose>
FROM DF_KEY_CONVERT_URL
<where>
<if test="optStartTime != null and optStartTime !=''">
<![CDATA[AND OP_TIME >= to_date(#{optStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="optEndTime != null and optEndTime !=''">
<![CDATA[AND OP_TIME < to_date(#{optEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchId != null and searchId !=''">
AND id > ${searchId}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -0,0 +1,20 @@
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DfKeyMailAdd;
/**
* @ClassName: DfKeyMailAddDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ZBC)
* @date 2016年11月09日 下午02:25:00
* @version V1.0
*/
@MyBatisDao
public interface DfKeyMailAddDao extends CrudDao<Serializable> {
List<DfKeyMailAdd> findDfKeyMailAddPage(DfKeyMailAdd entity);
}

View File

@@ -0,0 +1,45 @@
<?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.DfKeyMailAddDao">
<!-- DF_KEY_MAIL_ADDR -->
<sql id="dfKeyMailAddProperty">
ID,KEY_ID,MAIL_ADDR,OP_TIME
</sql>
<resultMap id="DfKeyMailAddMap" type="com.nis.domain.restful.DfKeyMailAdd">
<result column="id" jdbcType="INTEGER" property="id" />
<result column="key_id" jdbcType="INTEGER" property="keyId" />
<result column="mail_addr" jdbcType="VARCHAR" property="mailAddr" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<select id="findDfKeyMailAddPage" parameterType="com.nis.domain.restful.DfKeyMailAdd"
resultMap="DfKeyMailAddMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dfKeyMailAddProperty"/>
</otherwise>
</choose>
FROM DF_KEY_MAIL_ADDR
<where>
<if test="optStartTime != null and optStartTime !=''">
<![CDATA[AND OP_TIME >= to_date(#{optStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="optEndTime != null and optEndTime !=''">
<![CDATA[AND OP_TIME < to_date(#{optEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchId != null and searchId !=''">
AND id > ${searchId}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -0,0 +1,70 @@
/**
* @Title: DfLogSearchDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author ddm
* @date 2016年9月5日 下午44:6:25
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.ControlLog;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DfDnsLog;
import com.nis.domain.restful.DfFtpLog;
import com.nis.domain.restful.DfHttpKeywordLog;
import com.nis.domain.restful.DfHttpReqLog;
import com.nis.domain.restful.DfHttpResLog;
import com.nis.domain.restful.DfIpPortLog;
import com.nis.domain.restful.DfIpsecLog;
import com.nis.domain.restful.DfL2tpLog;
import com.nis.domain.restful.DfMailLog;
import com.nis.domain.restful.DfOpenvpnLog;
import com.nis.domain.restful.DfPptpLog;
import com.nis.domain.restful.DfSshLog;
import com.nis.domain.restful.DfSslLog;
import com.nis.domain.restful.DfTunnelRandomLog;
/**
* @ClassName: DfLogSearchDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ddm)
* @date 2016年9月5日 下午2:6:25
* @version V1.0
*/
@MyBatisDao
public interface DfLogSearchDao extends CrudDao<LogEntity> {
List<DfIpPortLog> findIpPortLogs(DfIpPortLog log);
List<DfHttpReqLog> findHttpReqLogs(DfHttpReqLog log);
List<DfHttpResLog> findHttpResLogs(DfHttpResLog log);
List<DfHttpKeywordLog> findHttpKeywordLogs(DfHttpKeywordLog log);
List<DfMailLog> findMailLogs(DfMailLog log);
List<DfDnsLog> findDnsLogs(DfDnsLog log);
List<DfFtpLog> findFtpLogs(DfFtpLog log);
List<DfPptpLog> findPptpLogs(DfPptpLog log);
List<DfL2tpLog> findL2tpLogs(DfL2tpLog log);
List<DfIpsecLog> findIpsecLogs(DfIpsecLog log);
List<DfOpenvpnLog> findOpenvpnLogs(DfOpenvpnLog log);
List<DfSshLog> findSshLogs(DfSshLog log);
List<DfSslLog> findSslLogs(DfSslLog log);
List<DfTunnelRandomLog> findTunnelRandomLogs(DfTunnelRandomLog log);
List<DfIpPortLog> findIpPortLogsCluster(DfIpPortLog log);
List<DfHttpReqLog> findHttpReqLogsCluster(DfHttpReqLog log);
List<DfHttpResLog> findHttpResLogsCluster(DfHttpResLog log);
List<DfHttpKeywordLog> findHttpKeywordLogsCluster(DfHttpKeywordLog log);
List<DfMailLog> findMailLogsCluster(DfMailLog log);
List<DfDnsLog> findDnsLogsCluster(DfDnsLog log);
List<DfFtpLog> findFtpLogsCluster(DfFtpLog log);
List<DfPptpLog> findPptpLogsCluster(DfPptpLog log);
List<DfL2tpLog> findL2tpLogsCluster(DfL2tpLog log);
List<DfIpsecLog> findIpsecLogsCluster(DfIpsecLog log);
List<DfOpenvpnLog> findOpenvpnLogsCluster(DfOpenvpnLog log);
List<DfSshLog> findSshLogsCluster(DfSshLog log);
List<DfSslLog> findSslLogsCluster(DfSslLog log);
List<DfTunnelRandomLog> findTunnelRandomLogsCluster(DfTunnelRandomLog log);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
/**
* @Title: DfLogSearchDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author ddm
* @date 2016年9月5日 下午44:6:25
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.ControlLog;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DfDnsLog;
import com.nis.domain.restful.DfFtpLog;
import com.nis.domain.restful.DfHttpKeywordLog;
import com.nis.domain.restful.DfHttpReqLog;
import com.nis.domain.restful.DfHttpResLog;
import com.nis.domain.restful.DfIpPortLog;
import com.nis.domain.restful.DfIpsecLog;
import com.nis.domain.restful.DfL2tpLog;
import com.nis.domain.restful.DfMailLog;
import com.nis.domain.restful.DfOpenvpnLog;
import com.nis.domain.restful.DfPptpLog;
import com.nis.domain.restful.DfSshLog;
import com.nis.domain.restful.DfSslLog;
import com.nis.domain.restful.DfTunnelRandomLog;
/**
* @ClassName: DfLogSearchDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ddm)
* @date 2016年9月5日 下午2:6:25
* @version V1.0
*/
@MyBatisDao
public interface DfLogSearchDaoCluster extends CrudDao<LogEntity> {
List<DfIpPortLog> findIpPortLogsCluster(DfIpPortLog log);
List<DfHttpReqLog> findHttpReqLogsCluster(DfHttpReqLog log);
List<DfHttpResLog> findHttpResLogsCluster(DfHttpResLog log);
List<DfHttpKeywordLog> findHttpKeywordLogsCluster(DfHttpKeywordLog log);
List<DfMailLog> findMailLogsCluster(DfMailLog log);
List<DfDnsLog> findDnsLogsCluster(DfDnsLog log);
List<DfFtpLog> findFtpLogsCluster(DfFtpLog log);
List<DfPptpLog> findPptpLogsCluster(DfPptpLog log);
List<DfL2tpLog> findL2tpLogsCluster(DfL2tpLog log);
List<DfIpsecLog> findIpsecLogsCluster(DfIpsecLog log);
List<DfOpenvpnLog> findOpenvpnLogsCluster(DfOpenvpnLog log);
List<DfSshLog> findSshLogsCluster(DfSshLog log);
List<DfSslLog> findSslLogsCluster(DfSslLog log);
List<DfTunnelRandomLog> findTunnelRandomLogsCluster(DfTunnelRandomLog log);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
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

@@ -0,0 +1,230 @@
<?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

@@ -0,0 +1,40 @@
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

@@ -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.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

@@ -0,0 +1,58 @@
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

@@ -0,0 +1,824 @@
<?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

@@ -0,0 +1,54 @@
/**
* @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

@@ -0,0 +1,857 @@
<?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

@@ -0,0 +1,48 @@
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

@@ -0,0 +1,776 @@
<?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

@@ -0,0 +1,64 @@
/**
* @Title: DjLogSearchDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author zbc
* @date 2016年9月7日 下午2:32:25
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DjDnsLog;
import com.nis.domain.restful.DjFtpLog;
import com.nis.domain.restful.DjHttpKeywordLog;
import com.nis.domain.restful.DjHttpReqLog;
import com.nis.domain.restful.DjHttpResLog;
import com.nis.domain.restful.DjIpPortLog;
import com.nis.domain.restful.DjIpsecLog;
import com.nis.domain.restful.DjL2tpLog;
import com.nis.domain.restful.DjMailLog;
import com.nis.domain.restful.DjOpenvpnLog;
import com.nis.domain.restful.DjPptpLog;
import com.nis.domain.restful.DjSshLog;
import com.nis.domain.restful.DjSslLog;
/**
* @ClassName: DjLogSearchDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月7日 下午2:32:25
* @version V1.0
*/
@MyBatisDao
@SuppressWarnings("rawtypes")
public interface DjLogSearchDao extends CrudDao<LogEntity>{
List<DjIpPortLog> findIpPortLogs(DjIpPortLog log);
List<DjHttpReqLog> findHttpReqLogs(DjHttpReqLog log);
List<DjHttpResLog> findHttpResLogs(DjHttpResLog log);
List<DjHttpKeywordLog> findHttpKeywordLogs(DjHttpKeywordLog log);
List<DjMailLog> findMailLogs(DjMailLog log);
List<DjDnsLog> findDnsLogs(DjDnsLog log);
List<DjFtpLog> findFtpLogs(DjFtpLog log);
List<DjPptpLog> findPptpLogs(DjPptpLog log);
List<DjL2tpLog> findL2tpLogs(DjL2tpLog log);
List<DjIpsecLog> findIpsecLogs(DjIpsecLog log);
List<DjOpenvpnLog> findOpenvpnLogs(DjOpenvpnLog log);
List<DjSshLog> findSshLogs(DjSshLog log);
List<DjSslLog> findSslLogs(DjSslLog log);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
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

@@ -0,0 +1,230 @@
<?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

@@ -0,0 +1,40 @@
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

@@ -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>

View File

@@ -0,0 +1,49 @@
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

@@ -0,0 +1,617 @@
<?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

@@ -0,0 +1,54 @@
/**
* @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

@@ -0,0 +1,858 @@
<?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>

View File

@@ -0,0 +1,17 @@
package com.nis.web.dao;
import com.nis.domain.restful.DmbCk;
/**
*
* @ClassName: DmbCkDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:03:33
* @version V1.0
*/
@MyBatisDao
public interface DmbCkDao extends CrudDao<DmbCk>{
int delete(long id);
int insert(DmbCk record);
int update(DmbCk record);
}

View File

@@ -0,0 +1,119 @@
<?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.DmbCkDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DmbCk">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="NAME" jdbcType="VARCHAR" property="name" />
<result column="POSITION" jdbcType="VARCHAR" property="position" />
<result column="COM_OPTION" jdbcType="VARCHAR" property="comOption" />
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
</resultMap>
<sql id="Base_Column_List">
ID, NAME, POSITION, COM_OPTION, CZYID, OP_TIME,LAST_UPDATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from DMB_CK
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="delete" parameterType="java.lang.Long">
delete from DMB_CK
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.nis.domain.restful.DmbCk">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DMB_CK.Nextval as ID from DUAL
</selectKey> -->
insert into DMB_CK (ID, NAME, POSITION,
COM_OPTION, CZYID, OP_TIME,LAST_UPDATE
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
#{comOption,jdbcType=VARCHAR}, #{czyid,jdbcType=BIGINT}, #{opTime,jdbcType=TIMESTAMP},
#{lastUpdate,jdbcType=TIMESTAMP}
)
</insert>
<!--
<insert id="insertSelective" parameterType="com.nis.domain.restful.DmbCk">
insert into DMB_CK
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="name != null">
NAME,
</if>
<if test="position != null">
POSITION,
</if>
<if test="comOption != null">
COM_OPTION,
</if>
<if test="czyid != null">
CZYID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="position != null">
#{position,jdbcType=VARCHAR},
</if>
<if test="comOption != null">
#{comOption,jdbcType=VARCHAR},
</if>
<if test="czyid != null">
#{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
-->
<update id="update" parameterType="com.nis.domain.restful.DmbCk">
update DMB_CK
<set>
<if test="name != null">
NAME = #{name,jdbcType=VARCHAR},
</if>
<if test="position != null">
POSITION = #{position,jdbcType=VARCHAR},
</if>
<if test="comOption != null">
COM_OPTION = #{comOption,jdbcType=VARCHAR},
</if>
<if test="czyid != null">
CZYID = #{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DmbCk">
update DMB_CK
set NAME = #{name,jdbcType=VARCHAR},
POSITION = #{position,jdbcType=VARCHAR},
COM_OPTION = #{comOption,jdbcType=VARCHAR},
CZYID = #{czyid,jdbcType=BIGINT},
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=BIGINT}
</update>
-->
</mapper>

View File

@@ -0,0 +1,19 @@
package com.nis.web.dao;
import com.nis.domain.restful.DmbPort;
/**
*
* @ClassName: DmbPortDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:04:55
* @version V1.0
*/
@MyBatisDao
public interface DmbPortDao extends CrudDao<DmbPort>{
int delete(long id);
int insert(DmbPort record);
int update(DmbPort record);
}

View File

@@ -0,0 +1,176 @@
<?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.DmbPortDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DmbPort">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="ENTRANCE_ID" jdbcType="BIGINT" property="entranceId" />
<result column="PORT_NAME" jdbcType="VARCHAR" property="portName" />
<result column="IS_USED" jdbcType="INTEGER" property="isUsed" />
<result column="IP_DZ" jdbcType="VARCHAR" property="ipDz" />
<result column="PORT_EQUIPMENT" jdbcType="VARCHAR" property="portEquipment" />
<result column="ODF_PORT" jdbcType="VARCHAR" property="odfPort" />
<result column="ADDR" jdbcType="VARCHAR" property="addr" />
<result column="CK_PORT" jdbcType="VARCHAR" property="ckPort" />
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
</resultMap>
<sql id="Base_Column_List">
ID, ENTRANCE_ID, PORT_NAME, IS_USED, IP_DZ, PORT_EQUIPMENT, ODF_PORT, ADDR, CK_PORT,
CZYID, OP_TIME,LAST_UPDATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from DMB_PORT
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="delete" parameterType="java.lang.Long">
delete from DMB_PORT
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.nis.domain.restful.DmbPort">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DMB_PORT.Nextval as ID from DUAL
</selectKey> -->
insert into DMB_PORT (ID, ENTRANCE_ID, PORT_NAME,
IS_USED, IP_DZ, PORT_EQUIPMENT,
ODF_PORT, ADDR, CK_PORT,
CZYID, OP_TIME,LAST_UPDATE)
values (#{id,jdbcType=BIGINT}, #{entranceId,jdbcType=BIGINT}, #{portName,jdbcType=VARCHAR},
#{isUsed,jdbcType=INTEGER}, #{ipDz,jdbcType=VARCHAR}, #{portEquipment,jdbcType=VARCHAR},
#{odfPort,jdbcType=VARCHAR}, #{addr,jdbcType=VARCHAR}, #{ckPort,jdbcType=VARCHAR},
#{czyid,jdbcType=BIGINT}, #{opTime,jdbcType=TIMESTAMP}, #{lastUpdate,jdbcType=TIMESTAMP})
</insert>
<!--
<insert id="insertSelective" parameterType="com.nis.domain.restful.DmbPort">
insert into DMB_PORT
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="entranceId != null">
ENTRANCE_ID,
</if>
<if test="portName != null">
PORT_NAME,
</if>
<if test="isUsed != null">
IS_USED,
</if>
<if test="ipDz != null">
IP_DZ,
</if>
<if test="portEquipment != null">
PORT_EQUIPMENT,
</if>
<if test="odfPort != null">
ODF_PORT,
</if>
<if test="addr != null">
ADDR,
</if>
<if test="ckPort != null">
CK_PORT,
</if>
<if test="czyid != null">
CZYID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="entranceId != null">
#{entranceId,jdbcType=BIGINT},
</if>
<if test="portName != null">
#{portName,jdbcType=VARCHAR},
</if>
<if test="isUsed != null">
#{isUsed,jdbcType=INTGER},
</if>
<if test="ipDz != null">
#{ipDz,jdbcType=VARCHAR},
</if>
<if test="portEquipment != null">
#{portEquipment,jdbcType=VARCHAR},
</if>
<if test="odfPort != null">
#{odfPort,jdbcType=VARCHAR},
</if>
<if test="addr != null">
#{addr,jdbcType=VARCHAR},
</if>
<if test="ckPort != null">
#{ckPort,jdbcType=VARCHAR},
</if>
<if test="czyid != null">
#{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
-->
<update id="update" parameterType="com.nis.domain.restful.DmbPort">
update DMB_PORT
<set>
<if test="entranceId != null">
ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
</if>
<if test="portName != null">
PORT_NAME = #{portName,jdbcType=VARCHAR},
</if>
<if test="isUsed != null">
IS_USED = #{isUsed,jdbcType=INTEGER},
</if>
<if test="ipDz != null">
IP_DZ = #{ipDz,jdbcType=VARCHAR},
</if>
<if test="portEquipment != null">
PORT_EQUIPMENT = #{portEquipment,jdbcType=VARCHAR},
</if>
<if test="odfPort != null">
ODF_PORT = #{odfPort,jdbcType=VARCHAR},
</if>
<if test="addr != null">
ADDR = #{addr,jdbcType=VARCHAR},
</if>
<if test="ckPort != null">
CK_PORT = #{ckPort,jdbcType=VARCHAR},
</if>
<if test="czyid != null">
CZYID = #{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DmbPort">
update DMB_PORT
set ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
PORT_NAME = #{portName,jdbcType=VARCHAR},
IS_USED = #{isUsed,jdbcType=INTEGER},
IP_DZ = #{ipDz,jdbcType=VARCHAR},
PORT_EQUIPMENT = #{portEquipment,jdbcType=VARCHAR},
ODF_PORT = #{odfPort,jdbcType=VARCHAR},
ADDR = #{addr,jdbcType=VARCHAR},
CK_PORT = #{ckPort,jdbcType=VARCHAR},
CZYID = #{czyid,jdbcType=BIGINT},
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=BIGINT}
</update>
-->
</mapper>

View File

@@ -0,0 +1,25 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.DnsFakeInfo;
/**
*
* @ClassName: DnsFakeInfoDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月8日 下午8:31:24
* @version V1.0
*/
@MyBatisDao
public interface DnsFakeInfoDao extends CrudDao<DnsFakeInfo>{
int delete(long id);
int insert(DnsFakeInfo record);
DnsFakeInfo selectByPrimaryKey(long id);
int update(DnsFakeInfo record);
int updateByPrimaryKey(DnsFakeInfo record);
int isValid(long id);
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
}

View File

@@ -0,0 +1,182 @@
<?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.DnsFakeInfoDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DnsFakeInfo">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="GROUP_ID" jdbcType="INTEGER" property="groupId" />
<result column="INFO" jdbcType="VARCHAR" property="info" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="YL1" jdbcType="INTEGER" property="yl1" />
<result column="YL2" jdbcType="INTEGER" property="yl2" />
<result column="YL3" jdbcType="VARCHAR" property="yl3" />
<result column="YL4" jdbcType="VARCHAR" property="yl4" />
<result column="YL5" jdbcType="VARCHAR" property="yl5" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
</resultMap>
<sql id="Base_Column_List">
ID, GROUP_ID, INFO, IS_VALID, OP_TIME, YL1, YL2, YL3, YL4, YL5,LAST_UPDATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from DNS_FAKE_INFO
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="delete" parameterType="java.lang.Long">
delete from DNS_FAKE_INFO
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.nis.domain.restful.DnsFakeInfo">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DNS_FAKE_INFO.Nextval as ID from DUAL
</selectKey>
-->
insert into DNS_FAKE_INFO (ID, GROUP_ID, INFO,
IS_VALID, OP_TIME, YL1,
YL2, YL3, YL4, YL5,LAST_UPDATE
)
values (#{id,jdbcType=BIGINT}, #{groupId,jdbcType=INTEGER}, #{info,jdbcType=VARCHAR},
#{isValid,jdbcType=INTEGER}, #{opTime,jdbcType=TIMESTAMP}, #{yl1,jdbcType=INTEGER},
#{yl2,jdbcType=INTEGER}, #{yl3,jdbcType=VARCHAR}, #{yl4,jdbcType=VARCHAR}, #{yl5,jdbcType=VARCHAR}
, #{lastUpdate,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.nis.domain.restful.DnsFakeInfo">
insert into DNS_FAKE_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="groupId != null">
GROUP_ID,
</if>
<if test="info != null">
INFO,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="yl1 != null">
YL1,
</if>
<if test="yl2 != null">
YL2,
</if>
<if test="yl3 != null">
YL3,
</if>
<if test="yl4 != null">
YL4,
</if>
<if test="yl5 != null">
YL5,
</if>
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="groupId != null">
#{groupId,jdbcType=INTEGER},
</if>
<if test="info != null">
#{info,jdbcType=VARCHAR},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="yl1 != null">
#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
#{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
#{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
#{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
#{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="update" parameterType="com.nis.domain.restful.DnsFakeInfo">
update DNS_FAKE_INFO
<set>
<if test="groupId != null">
GROUP_ID = #{groupId,jdbcType=INTEGER},
</if>
<if test="info != null">
INFO = #{info,jdbcType=VARCHAR},
</if>
<if test="isValid != null">
IS_VALID = #{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="yl1 != null">
YL1 = #{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
YL2 = #{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
YL3 = #{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
YL4 = #{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
YL5 = #{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
select IS_VALID FROM DNS_FAKE_INFO
WHERE ID = #{id,jdbcType=BIGINT}
</select>
<select id="isValidBatch" resultType="java.lang.Integer">
select count(ID) FROM DNS_FAKE_INFO
WHERE ID in(
<foreach collection="idsList" item="ids" separator=",">
#{ids}
</foreach>
) and IS_VALID=#{isValid}
</select>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DnsFakeInfo">
update DNS_FAKE_INFO
set GROUP_ID = #{groupId,jdbcType=DECIMAL},
INFO = #{info,jdbcType=VARCHAR},
IS_VALID = #{isValid,jdbcType=DECIMAL},
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
YL1 = #{yl1,jdbcType=DECIMAL},
YL2 = #{yl2,jdbcType=DECIMAL},
YL3 = #{yl3,jdbcType=VARCHAR},
YL4 = #{yl4,jdbcType=VARCHAR},
YL5 = #{yl5,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL}
</update>
-->
</mapper>

View File

@@ -0,0 +1,32 @@
/**
*@Title: DnsGroupTypeDao.java
*@Package com.nis.web.dao
*@Description TODO
*@author dell
*@date 2016年9月7日 下午3:14:24
*@version 版本号
*/
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.DnsFakeIp;
/**
* @ClassName: DnsGroupTypeDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月7日 下午3:14:24
* @version V1.0
*/
@MyBatisDao
public interface DnsFakeIpDao extends CrudDao<DnsFakeIp> {
void save(DnsFakeIp dnsFakeIp);
void saveBatch(List<DnsFakeIp> dnsFakeIpList);
void updateBatch(List<DnsFakeIp> dnsFakeIpList);
void delete(long id);
int isValid(long id);
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
}

View File

@@ -0,0 +1,284 @@
<?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.DnsFakeIpDao" >
<resultMap type="dnsFakeIp" id="dnsFakeIpMap">
<id property="id" column="ID"/>
<result property="groupId" column="GROUP_ID"/>
<result property="addrType" column="ADDR_TYPE"/>
<result property="srcIp" column="SRC_IP"/>
<result property="maskSrcIp" column="MASK_SRC_IP"/>
<result property="srcPort" column="SRC_PORT"/>
<result property="maskSrcPort" column="MASK_SRC_PORT"/>
<result property="dstIp" column="DST_IP"/>
<result property="maskDstIp" column="MASK_DST_IP"/>
<result property="dstPort" column="DST_PORT"/>
<result property="maskDstPort" column="MASK_DST_PORT"/>
<result property="protocol" column="PROTOCOL"/>
<result property="direction" column="DIRECTION"/>
<result property="opTime" column="OP_TIME"/>
<result property="isValid" column="IS_VALID"/>
<result property="yl1" column="YL1"/>
<result property="yl2" column="YL2"/>
<result property="yl3" column="YL3"/>
<result property="yl4" column="YL4"/>
<result property="yl5" column="YL5"/>
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
</resultMap>
<sql id="dnsFakeIpColumns">
id,
groupId,
addrType,
srcIp,
maskSrcIp,
srcPort,
maskSrcPort,
dstIp,
maskDstIp,
dstPort,
maskDstPort,
protocol,
direction,
opTime,
isValid,
yl1,
yl2,
yl3,
yl4,
yl5,
lastUpdate
</sql>
<!--
<insert id="insert" parameterType="dnsFakeIp" >
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DNS_FAKE_IP.Nextval as ID from DUAL
</selectKey>
insert into DNS_FAKE_IP(ID,GROUP_ID,ADDR_TYPE,SRC_IP,MASK_SRC_IP,SRC_PORT,MASK_SRC_PORT,
DST_IP,MASK_DST_IP,DST_PORT,MASK_DST_PORT,PROTOCOL,DIRECTION,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5)
values (#{id},#{groupId},#{addrType},#{srcIp},#{maskSrcIp},#{srcPort},#{maskSrcPort},#{dstIp}
,#{maskDstIp},#{dstPort},#{maskDstPort},#{protocol},#{direction},#{opTime},#{isValid}
,#{yl1},#{yl2},#{yl3},#{yl4},#{yl5})
</insert>
-->
<insert id="insert" parameterType="com.nis.domain.restful.DnsFakeIp">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DNS_FAKE_IP.Nextval as ID from DUAL
</selectKey>
-->
insert into DNS_FAKE_IP
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="groupId != null">
GROUP_ID,
</if>
<if test="addrType != null">
ADDR_TYPE,
</if>
<if test="srcIp != null">
SRC_IP,
</if>
<if test="maskSrcIp != null">
MASK_SRC_IP,
</if>
<if test="srcPort != null">
SRC_PORT,
</if>
<if test="maskSrcPort != null">
MASK_SRC_PORT,
</if>
<if test="dstIp != null">
DST_IP,
</if>
<if test="maskDstIp != null">
MASK_DST_IP,
</if>
<if test="dstPort != null">
DST_PORT,
</if>
<if test="maskDstPort != null">
MASK_DST_PORT,
</if>
<if test="protocol != null">
PROTOCOL,
</if>
<if test="direction != null">
DIRECTION,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="yl1 != null">
YL1,
</if>
<if test="yl2 != null">
YL2,
</if>
<if test="yl3 != null">
YL3,
</if>
<if test="yl4 != null">
YL4,
</if>
<if test="yl5 != null">
YL5,
</if>
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="groupId != null">
#{groupId,jdbcType=INTEGER},
</if>
<if test="addrType != null">
#{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null">
#{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null">
#{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null">
#{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null">
#{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null">
#{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null">
#{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null">
#{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null">
#{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
#{direction,jdbcType=INTEGER},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="yl1 != null">
#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
#{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
#{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
#{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
#{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="update" parameterType="dnsFakeIp">
UPDATE DNS_FAKE_IP
<set>
<if test="groupId != null">
GROUP_ID=#{groupId,jdbcType=INTEGER},
</if>
<if test="addrType != null">
ADDR_TYPE=#{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null">
SRC_IP=#{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null">
MASK_SRC_IP=#{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null">
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null">
MASK_SRC_PORT=#{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null">
DST_IP=#{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null">
MASK_DST_IP=#{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null">
DST_PORT=#{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null">
MASK_DST_PORT=#{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
PROTOCOL=#{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
DIRECTION=#{direction,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="isValid != null">
IS_VALID=#{isValid,jdbcType=INTEGER},
</if>
<if test="yl1 != null">
YL1=#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
YL2=#{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
YL3=#{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
YL4=#{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
YL5=#{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id ,jdbcType=BIGINT }
</update>
<delete id="delete" parameterType="long">
DELETE FROM DNS_FAKE_IP
WHERE ID = #{id,jdbcType=BIGINT}
</delete>
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
select IS_VALID FROM DNS_FAKE_IP
WHERE ID = #{id,jdbcType=BIGINT}
</select>
<select id="isValidBatch" resultType="java.lang.Integer">
select count(ID) FROM DNS_FAKE_IP
WHERE ID in(
<foreach collection="idsList" item="ids" separator=",">
#{ids}
</foreach>
) and IS_VALID=#{isValid}
</select>
</mapper>

View File

@@ -0,0 +1,34 @@
/**
*@Title: DnsGroupTypeDao.java
*@Package com.nis.web.dao
*@Description TODO
*@author dell
*@date 2016年9月7日 下午3:14:24
*@version 版本号
*/
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.DnsGroupType;
/**
* @ClassName: DnsGroupTypeDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月7日 下午3:14:24
* @version V1.0
*/
@MyBatisDao
public interface DnsGroupTypeDao extends CrudDao<DnsGroupType> {
List<DnsGroupType> getDnsGroupType(DnsGroupType DnsGroupType);
void save(DnsGroupType DnsGroupType);
void saveBatch(List<DnsGroupType> DnsGroupTypeList);
void updateBatch(List<DnsGroupType> DnsGroupTypeList);
void delete(long id);
int isValid(long id);
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
int isGroupIdUnique(@Param("idsList")List<Integer> idsList);
}

View File

@@ -0,0 +1,141 @@
<?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.DnsGroupTypeDao" >
<resultMap type="dnsGroupType" id="dnsGroupTypeMap">
<id property="id" column="ID"/>
<result property="groupId" column="GROUP_ID"/>
<result property="groupName" column="GROUP_NAME"/>
<result property="resTypeId" column="RES_TYPE_ID"/>
<result property="opTime" column="OP_TIME"/>
<result property="isValid" column="IS_VALID"/>
<result property="yl1" column="YL1"/>
<result property="yl2" column="YL2"/>
<result property="yl3" column="YL3"/>
<result property="yl4" column="YL4"/>
<result property="yl5" column="YL5"/>
<result property="lastUpdate" column="LAST_UPDATE"/>
</resultMap>
<sql id="dnsGroupTypeColumns">
id,
groupId,
groupName,
resTypeId,
opTime,
isValid,
yl1,
yl2,
yl3,
yl4,
yl5,
lastUpdate
</sql>
<!--
<select id="get" resultMap="dnsGroupTypeMap">
select
<include refid="dnsGroupTypeColumns"/>
from DNS_GROUP_TYPE
WHERE id=#{id}
</select>
<select id="findList" resultMap="dnsGroupTypeMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dnsGroupTypeColumns"/>
</otherwise>
</choose>
from DNS_GROUP_TYPE
WHERE 1=1
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY id desc
</otherwise>
</choose>
</select>
-->
<insert id="insert" parameterType="dnsGroupType" >
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DNS_GROUP_TYPE.Nextval as ID from DUAL
</selectKey>
-->
insert into DNS_GROUP_TYPE(ID,GROUP_ID,GROUP_NAME,RES_TYPE_ID,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5,LAST_UPDATE)
values (#{id},#{groupId},#{groupName},#{resTypeId},#{opTime},#{isValid},#{yl1},#{yl2},#{yl3},#{yl4},#{yl5},#{lastUpdate})
</insert>
<update id="update" parameterType="dnsGroupType">
UPDATE DNS_GROUP_TYPE
<set>
<if test="groupId != null">
GROUP_ID=#{groupId,jdbcType=INTEGER},
</if>
<if test="groupName != null">
GROUP_NAME=#{groupName,jdbcType=VARCHAR},
</if>
<if test="resTypeId != null">
RES_TYPE_ID=#{resTypeId,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="isValid != null">
IS_VALID=#{isValid,jdbcType=INTEGER},
</if>
<if test="yl1 != null">
YL1=#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
YL2=#{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
YL3=#{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
YL4=#{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
YL5=#{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id ,jdbcType=BIGINT }
</update>
<delete id="delete" parameterType="long">
DELETE FROM DNS_GROUP_TYPE
WHERE ID = #{id,jdbcType=BIGINT}
</delete>
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
select IS_VALID FROM DNS_GROUP_TYPE
WHERE ID = #{id,jdbcType=BIGINT}
</select>
<select id="isValidBatch" resultType="java.lang.Integer">
select count(ID) FROM DNS_GROUP_TYPE
WHERE ID in(
<foreach collection="idsList" item="ids" separator=",">
#{ids}
</foreach>
) and IS_VALID=#{isValid}
</select>
<select id="isGroupIdUnique" resultType="java.lang.Integer">
select COUNT(ID) FROM DNS_GROUP_TYPE
WHERE GROUP_ID in(
<foreach collection="idsList" item="ids" separator=",">
#{ids,jdbcType=INTEGER}
</foreach>
)
</select>
</mapper>

View File

@@ -0,0 +1,36 @@
/**
*@Title: DnsResponseStrategyDao.java
*@Package com.nis.web.dao
*@Description TODO
*@author dell
*@date 2016年9月5日 下午5:45:51
*@version 版本号
*/
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.DnsResponseStrategy;
/**
* @ClassName: DnsResponseStrategyDao.java
* @Description: TODO
* @author (wx)
* @date 2016年9月5日 下午5:45:51
* @version V1.0
*/
@MyBatisDao
public interface DnsResponseStrategyDao extends CrudDao<DnsResponseStrategy> {
List<DnsResponseStrategy> getDnsResponseStrategy(DnsResponseStrategy dnsResponseStrategy);
void save(DnsResponseStrategy dnsResponseStrategy);
void saveBatch(List<DnsResponseStrategy> dnsResponseStrategyList);
void updateBatch(List<DnsResponseStrategy> dnsResponseStrategyList);
void delete(long id);
int isValid(long id);
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
int isReqStrateIdUnique(@Param("idsList")List<Integer> idsList);
}

View File

@@ -0,0 +1,377 @@
<?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.DnsResponseStrategyDao" >
<resultMap type="dnsResponseStrategy" id="dnsResponseStrategyMap">
<id property="id" column="ID"/>
<result property="reqStrateId" column="REQ_STRATE_ID"/>
<result property="strateName" column="STRATE_NAME"/>
<result property="resGroupOneId" column="RES_GROUP_1_ID"/>
<result property="resGroupOneNum" column="RES_GROUP_1_NUM"/>
<result property="resGroupTwoId" column="RES_GROUP_2_ID"/>
<result property="resGroupTwoNum" column="RES_GROUP_2_NUM"/>
<result property="resGroupThreeId" column="RES_GROUP_3_ID"/>
<result property="resGroupThreeNum" column="RES_GROUP_3_NUM"/>
<result property="resGroupFourId" column="RES_GROUP_4_ID"/>
<result property="resGroupFourNum" column="RES_GROUP_4_NUM"/>
<result property="resGroupFiveId" column="RES_GROUP_5_ID"/>
<result property="resGroupFiveNum" column="RES_GROUP_5_NUM"/>
<result property="authGroup" column="AUTH_GROUP"/>
<result property="addGroup" column="ADD_GROUP"/>
<result property="opTime" column="OP_TIME"/>
<result property="isValid" column="IS_VALID"/>
<result property="yl1" column="YL1"/>
<result property="yl2" column="YL2"/>
<result property="yl3" column="YL3"/>
<result property="yl4" column="YL4"/>
<result property="yl5" column="YL5"/>
<result property="lastUpdate" column="LAST_UPDATE"/>
<result property="minTtl" column="MIN_TTL"/>
<result property="maxTtl" column="MAX_TTL"/>
</resultMap>
<sql id="dnsResponseStrategyColumns">
id,
reqStrateId,
strateName,
resGroupOneId,
resGroupOneNum,
resGroupTwoId,
resGroupTwoNum,
resGroupThreeId,
resGroupThreeNum,
resGroupFourId,
resGroupFourNum,
resGroupFiveId,
resGroupFiveNum,
authGroup,
addGroup,
opTime,
isValid,
yl1,
yl2,
yl3,
yl4,
yl5,
lastUpdate,
minTtl,
maxTtl
</sql>
<!--
<select id="get" resultMap="dnsResponseStrategyMap">
select
<include refid="dnsResponseStrategyColumns"/>
from DNS_RESPONSE_STRATEGY
WHERE id=#{id}
</select>
<select id="findList" resultMap="dnsResponseStrategyMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dnsResponseStrategyColumns"/>
</otherwise>
</choose>
from DNS_RESPONSE_STRATEGY
WHERE 1=1
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY id desc
</otherwise>
</choose>
</select>
-->
<!--
<insert id="insert" parameterType="dnsResponseStrategy" >
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DNS_RESPONSE_STRATEGY.Nextval as ID from DUAL
</selectKey>
insert into DNS_RESPONSE_STRATEGY(ID,REQ_STRATE_ID,STRATE_NAME,RES_GROUP_1_ID,RES_GROUP_1_NUM
,RES_GROUP_2_ID,RES_GROUP_2_NUM,AUTH_GROUP,ADD_GROUP,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5)
values (#{id},#{reqStrateId},#{strateName},#{resGroupOneId},#{resGroupOneNum},#{resGroupTwoId},#{resGroupTwoNum},
#{authGroup},#{addGroup},#{opTime},#{isValid},#{yl1},#{yl2},#{yl3},#{yl4},#{yl5})
</insert>
-->
<insert id="insert" parameterType="com.nis.domain.restful.DnsResponseStrategy">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DNS_RESPONSE_STRATEGY.Nextval as ID from DUAL
</selectKey>
-->
insert into DNS_RESPONSE_STRATEGY
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="reqStrateId != null">
REQ_STRATE_ID,
</if>
<if test="strateName != null">
STRATE_NAME,
</if>
<if test="resGroupOneId != null">
RES_GROUP_1_ID,
</if>
<if test="resGroupOneNum != null">
RES_GROUP_1_NUM,
</if>
<if test="resGroupTwoId != null">
RES_GROUP_2_ID,
</if>
<if test="resGroupTwoNum != null">
RES_GROUP_2_NUM,
</if>
<if test="resGroupThreeId != null">
RES_GROUP_3_ID,
</if>
<if test="resGroupThreeNum != null">
RES_GROUP_3_NUM,
</if>
<if test="resGroupFourId != null">
RES_GROUP_4_ID,
</if>
<if test="resGroupFourNum != null">
RES_GROUP_4_NUM,
</if>
<if test="resGroupFiveId != null">
RES_GROUP_5_ID,
</if>
<if test="resGroupFiveNum != null">
RES_GROUP_5_NUM,
</if>
<if test="authGroup != null">
AUTH_GROUP,
</if>
<if test="addGroup != null">
ADD_GROUP,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="yl1 != null">
YL1,
</if>
<if test="yl2 != null">
YL2,
</if>
<if test="yl3 != null">
YL3,
</if>
<if test="yl4 != null">
YL4,
</if>
<if test="yl5 != null">
YL5,
</if>
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
<if test="minTtl != null">
MIN_TTL,
</if>
<if test="maxTtl != null">
MAX_TTL,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="reqStrateId != null">
#{reqStrateId,jdbcType=INTEGER},
</if>
<if test="strateName != null">
#{strateName,jdbcType=VARCHAR},
</if>
<if test="resGroupOneId != null">
#{resGroupOneId,jdbcType=INTEGER},
</if>
<if test="resGroupOneNum != null">
#{resGroupOneNum,jdbcType=INTEGER},
</if>
<if test="resGroupTwoId != null">
#{resGroupTwoId,jdbcType=INTEGER},
</if>
<if test="resGroupTwoNum != null">
#{resGroupTwoNum,jdbcType=INTEGER},
</if>
<if test="resGroupThreeId != null">
#{resGroupThreeId,jdbcType=INTEGER},
</if>
<if test="resGroupThreeNum != null">
#{resGroupThreeNum,jdbcType=INTEGER},
</if>
<if test="resGroupFourId != null">
#{resGroupFourId,jdbcType=INTEGER},
</if>
<if test="resGroupFourNum != null">
#{resGroupFourNum,jdbcType=INTEGER},
</if>
<if test="resGroupFiveId != null">
#{resGroupFiveId,jdbcType=INTEGER},
</if>
<if test="resGroupFiveNum != null">
#{resGroupFiveNum,jdbcType=INTEGER},
</if>
<if test="authGroup != null">
#{authGroup,jdbcType=INTEGER},
</if>
<if test="addGroup != null">
#{addGroup,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="yl1 != null">
#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
#{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
#{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
#{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
#{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="minTtl != null">
#{minTtl,jdbcType=INTEGER},
</if>
<if test="maxTtl != null">
#{maxTtl,jdbcType=INTEGER},
</if>
</trim>
</insert>
<!--
<insert id="saveBatch" parameterType="java.util.List">
insert into DNS_RESPONSE_STRATEGY(ID,REQ_STRATE_ID,STRATE_NAME,RES_GROUP_1_ID,RES_GROUP_1_NUM
,RES_GROUP_2_ID,RES_GROUP_2_NUM,AUTH_GROUP,ADD_GROUP,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5)
<foreach collection="list" item="item" index="index" separator="union all">
(select SEQ_DNS_RESPONSE_STRATEGY.Nextval,#{item.reqStrateId,jdbcType=NUMBER },#{item.strateName,jdbcType=VARCHAR2},#{item.resGroupOneId,jdbcType=NUMBER},#{item.resGroupOneNum,jdbcType=NUMBER},#{item.resGroupTwoId,jdbcType=NUMBER},#{item.resGroupTwoNum,jdbcType=NUMBER},
#{item.authGroup,jdbcType=NUMBER},#{item.addGroup,jdbcType=NUMBER},#{item.opTime,jdbcType=DATE},#{item.isValid,jdbcType=NUMBER},#{item.yl1,jdbcType=NUMBER},#{item.yl2,jdbcType=NUMBER},#{item.yl3,jdbcType=VARCHAR2},#{item.yl4,jdbcType=VARCHAR2},#{item.yl5,jdbcType=VARCHAR2} from dual)
</foreach>
</insert>
-->
<update id="update" parameterType="dnsResponseStrategy">
UPDATE DNS_RESPONSE_STRATEGY
<set>
<if test="reqStrateId != null">
REQ_STRATE_ID=#{reqStrateId,jdbcType=INTEGER},
</if>
<if test="strateName != null">
STRATE_NAME=#{strateName,jdbcType=VARCHAR},
</if>
<if test="resGroupOneId != null">
RES_GROUP_1_ID=#{resGroupOneId,jdbcType=INTEGER},
</if>
<if test="resGroupOneNum != null">
RES_GROUP_1_NUM=#{resGroupOneNum,jdbcType=INTEGER},
</if>
<if test="resGroupTwoId != null">
RES_GROUP_2_ID=#{resGroupTwoId,jdbcType=INTEGER},
</if>
<if test="resGroupTwoNum != null">
RES_GROUP_2_NUM=#{resGroupTwoNum,jdbcType=INTEGER},
</if>
<if test="resGroupThreeId != null">
RES_GROUP_3_ID=#{resGroupThreeId,jdbcType=INTEGER},
</if>
<if test="resGroupThreeNum != null">
RES_GROUP_3_NUM=#{resGroupThreeNum,jdbcType=INTEGER},
</if>
<if test="resGroupFourId != null">
RES_GROUP_4_ID=#{resGroupFourId,jdbcType=INTEGER},
</if>
<if test="resGroupFourNum != null">
RES_GROUP_4_NUM=#{resGroupFourNum,jdbcType=INTEGER},
</if>
<if test="resGroupFiveId != null">
RES_GROUP_5_ID=#{resGroupFiveId,jdbcType=INTEGER},
</if>
<if test="resGroupFiveNum != null">
RES_GROUP_5_NUM=#{resGroupFiveNum,jdbcType=INTEGER},
</if>
<if test="authGroup != null">
AUTH_GROUP=#{authGroup,jdbcType=INTEGER},
</if>
<if test="addGroup != null">
ADD_GROUP=#{addGroup,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="isValid != null">
IS_VALID=#{isValid,jdbcType=INTEGER},
</if>
<if test="yl1 != null">
YL1=#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null">
YL2=#{yl2,jdbcType=INTEGER},
</if>
<if test="yl3 != null">
YL3=#{yl3,jdbcType=VARCHAR},
</if>
<if test="yl4 != null">
YL4=#{yl4,jdbcType=VARCHAR},
</if>
<if test="yl5 != null">
YL5=#{yl5,jdbcType=VARCHAR},
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="minTtl != null">
MIN_TTL=#{minTtl,jdbcType=INTEGER},
</if>
<if test="maxTtl != null">
MAX_TTL=#{maxTtl,jdbcType=INTEGER},
</if>
</set>
where ID = #{id ,jdbcType=BIGINT }
</update>
<delete id="delete" parameterType="long">
DELETE FROM DNS_RESPONSE_STRATEGY
WHERE ID = #{id,jdbcType=BIGINT}
</delete>
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
select IS_VALID FROM DNS_RESPONSE_STRATEGY
WHERE ID = #{id,jdbcType=BIGINT}
</select>
<select id="isReqStrateIdUnique" resultType="java.lang.Integer">
select COUNT(ID) FROM DNS_RESPONSE_STRATEGY
WHERE REQ_STRATE_ID in(
<foreach collection="idsList" item="ids" separator=",">
#{ids,jdbcType=INTEGER}
</foreach>
)
</select>
<select id="isValidBatch" resultType="java.lang.Integer">
select count(ID) FROM DNS_RESPONSE_STRATEGY
WHERE ID in(
<foreach collection="idsList" item="ids" separator=",">
#{ids}
</foreach>
) and IS_VALID=#{isValid}
</select>
</mapper>

View File

@@ -0,0 +1,9 @@
package com.nis.web.dao;
import com.nis.domain.restful.EncryptProtoRandom;
@MyBatisDao
public interface EncryptProtoRandomDao extends CrudDao<EncryptProtoRandom>{
int delete(Long id);
int insert(EncryptProtoRandom record);
int update(EncryptProtoRandom record);
}

View File

@@ -0,0 +1,112 @@
<?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.EncryptProtoRandomDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.EncryptProtoRandom">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="RANDOM_VALUE" jdbcType="INTEGER" property="randomValue" />
<result column="PROTO" jdbcType="INTEGER" property="proto" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="PROC_SEQ" jdbcType="INTEGER" property="procSeq" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
</resultMap>
<sql id="Base_Column_List">
ID, RANDOM_VALUE, PROTO, OP_TIME, IS_VALID, PROC_SEQ, LAST_UPDATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ENCRYPT_PROTO_RANDOM
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="delete" parameterType="java.lang.Long">
delete from ENCRYPT_PROTO_RANDOM
where ID = #{id,jdbcType=BIGINT}
</delete>
<!--
<insert id="insert" parameterType="com.nis.domain.restful.EncryptProtoRandom">
insert into ENCRYPT_PROTO_RANDOM (ID, RANDOM_VALUE, PROTO,
OP_TIME, IS_VALID, PROC_SEQ,
LAST_UPDATE)
values (#{id,jdbcType=INTEGER}, #{randomValue,jdbcType=INTEGER}, #{proto,jdbcType=INTEGER},
#{opTime,jdbcType=TIMESTAMP}, #{isValid,jdbcType=INTEGER}, #{procSeq,jdbcType=INTEGER},
#{lastUpdate,jdbcType=TIMESTAMP})
</insert>
-->
<insert id="insert" parameterType="com.nis.domain.restful.EncryptProtoRandom">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_ENCRYPT_PROTO_RANDOM.Nextval as ID from DUAL
</selectKey>
-->
insert into ENCRYPT_PROTO_RANDOM
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="randomValue != null">
RANDOM_VALUE,
</if>
<if test="proto != null">
PROTO,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="randomValue != null">
#{randomValue,jdbcType=INTEGER},
</if>
<if test="proto != null">
#{proto,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="update" parameterType="com.nis.domain.restful.EncryptProtoRandom">
update ENCRYPT_PROTO_RANDOM
<set>
<if test="randomValue != null">
RANDOM_VALUE = #{randomValue,jdbcType=INTEGER},
</if>
<if test="proto != null">
PROTO = #{proto,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="isValid != null">
IS_VALID = #{isValid,jdbcType=INTEGER},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.EncryptProtoRandom">
update ENCRYPT_PROTO_RANDOM
set RANDOM_VALUE = #{randomValue,jdbcType=INTEGER},
PROTO = #{proto,jdbcType=INTEGER},
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
IS_VALID = #{isValid,jdbcType=INTEGER},
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=INTEGER}
</update>
-->
</mapper>

View File

@@ -0,0 +1,25 @@
package com.nis.web.dao;
import com.nis.domain.restful.FakeIpConfigCompile;
/**
*
* @ClassName: FakeIpConfigCompileDao.java
* @Description: TODO
* @author (wx)
* @date 2016年9月8日 下午3:23:07
* @version V1.0
*/
@MyBatisDao
public interface FakeIpConfigCompileDao extends CrudDao<FakeIpConfigCompile> {
int delete(Long compileId);
long getCompileId();
int insert(FakeIpConfigCompile record);
int insertSelective(FakeIpConfigCompile record);
FakeIpConfigCompile selectByPrimaryKey(Long compileId);
int updateByPrimaryKeySelective(FakeIpConfigCompile record);
int updateByPrimaryKey(FakeIpConfigCompile record);
}

View File

@@ -0,0 +1,170 @@
<?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.FakeIpConfigCompileDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.FakeIpConfigCompile">
<id column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
<result column="SERVICE" jdbcType="INTEGER" property="service" />
<result column="ACTION" jdbcType="INTEGER" property="action" />
<result column="DO_BLACKLIST" jdbcType="INTEGER" property="doBlacklist" />
<result column="DO_LOG" jdbcType="INTEGER" property="doLog" />
<result column="EFFECTIVE_RANGE" jdbcType="VARCHAR" property="effectiveRange" />
<result column="USER_REGION" jdbcType="VARCHAR" property="userRegion" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="GROUP_NUM" jdbcType="INTEGER" property="groupNum" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
<result property="activeSys" jdbcType="INTEGER" column="ACTIVE_SYS"/>
</resultMap>
<sql id="Base_Column_List">
COMPILE_ID, SERVICE, ACTION, DO_BLACKLIST, DO_LOG, EFFECTIVE_RANGE, USER_REGION,
IS_VALID, OP_TIME, GROUP_NUM,LAST_UPDATE,ACTIVE_SYS
</sql>
<!--
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from FAKE_IP_CONFIG_COMPILE
where COMPILE_ID = #{compileId,jdbcType=BIGINT}
</select>
-->
<delete id="delete" parameterType="java.lang.Long">
delete from FAKE_IP_CONFIG_COMPILE
where COMPILE_ID = #{compileId,jdbcType=BIGINT}
</delete>
<select resultType="java.lang.Long" id="getCompileId" flushCache="true" useCache="false">
select SEQ_FAKE_IP_CONFIG_COMPILE.Nextval as ID from DUAL
</select>
<insert id="insert" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
insert into FAKE_IP_CONFIG_COMPILE (COMPILE_ID, SERVICE, ACTION,
DO_BLACKLIST, DO_LOG, EFFECTIVE_RANGE,
USER_REGION, IS_VALID, OP_TIME,
GROUP_NUM,LAST_UPDATE,ACTIVE_SYS)
values (#{compileId,jdbcType=BIGINT}, #{service,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
#{doBlacklist,jdbcType=INTEGER}, #{doLog,jdbcType=INTEGER}, #{effectiveRange,jdbcType=VARCHAR},
#{userRegion,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{opTime,jdbcType=TIMESTAMP},
#{groupNum,jdbcType=INTEGER}, #{lastUpdate,jdbcType=TIMESTAMP},#{activeSys,jdbcType=INTEGER})
</insert>
<!--
<insert id="insertSelective" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
insert into FAKE_IP_CONFIG_COMPILE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="compileId != null">
COMPILE_ID,
</if>
<if test="service != null">
SERVICE,
</if>
<if test="action != null">
ACTION,
</if>
<if test="doBlacklist != null">
DO_BLACKLIST,
</if>
<if test="doLog != null">
DO_LOG,
</if>
<if test="effectiveRange != null">
EFFECTIVE_RANGE,
</if>
<if test="userRegion != null">
USER_REGION,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="groupNum != null">
GROUP_NUM,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="compileId != null">
#{compileId,jdbcType=BIGINT},
</if>
<if test="service != null">
#{service,jdbcType=INTEGER},
</if>
<if test="action != null">
#{action,jdbcType=INTEGER},
</if>
<if test="doBlacklist != null">
#{doBlacklist,jdbcType=INTEGER},
</if>
<if test="doLog != null">
#{doLog,jdbcType=INTEGER},
</if>
<if test="effectiveRange != null">
#{effectiveRange,jdbcType=BIGINT},
</if>
<if test="userRegion != null">
#{userRegion,jdbcType=VARCHAR},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="groupNum != null">
#{groupNum,jdbcType=INTEGER},
</if>
</trim>
</insert>
-->
<update id="update" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
update FAKE_IP_CONFIG_COMPILE
<set>
<if test="service != null">
SERVICE = #{service,jdbcType=INTEGER},
</if>
<if test="action != null">
ACTION = #{action,jdbcType=INTEGER},
</if>
<if test="doBlacklist != null">
DO_BLACKLIST = #{doBlacklist,jdbcType=INTEGER},
</if>
<if test="doLog != null">
DO_LOG = #{doLog,jdbcType=INTEGER},
</if>
<if test="effectiveRange != null">
EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},
</if>
<if test="userRegion != null">
USER_REGION = #{userRegion,jdbcType=VARCHAR},
</if>
<if test="isValid != null">
IS_VALID = #{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="groupNum != null">
GROUP_NUM = #{groupNum,jdbcType=INTEGER},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="activeSys != null">
ACTIVE_SYS = #{activeSys,jdbcType=INTEGER},
</if>
</set>
where COMPILE_ID = #{compileId,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
update FAKE_IP_CONFIG_COMPILE
set SERVICE = #{service,jdbcType=DECIMAL},
ACTION = #{action,jdbcType=DECIMAL},
DO_BLACKLIST = #{doBlacklist,jdbcType=DECIMAL},
DO_LOG = #{doLog,jdbcType=DECIMAL},
EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},
USER_REGION = #{userRegion,jdbcType=VARCHAR},
IS_VALID = #{isValid,jdbcType=DECIMAL},
OP_TIME = #{opTime,jdbcType=DATE},
GROUP_NUM = #{groupNum,jdbcType=DECIMAL}
where COMPILE_ID = #{compileId,jdbcType=DECIMAL}
</update>
-->
</mapper>

View File

@@ -0,0 +1,17 @@
package com.nis.web.dao;
import com.nis.domain.restful.FakeIpConfigGroup;
/**
*
* @ClassName: FakeIpConfigGroupDao.java
* @Description: TODO
* @author (wx)
* @date 2016年9月8日 下午3:25:17
* @version V1.0
*/
@MyBatisDao
public interface FakeIpConfigGroupDao extends CrudDao<FakeIpConfigGroup>{
int insert(FakeIpConfigGroup record);
// int delete(long record);
int insertSelective(FakeIpConfigGroup record);
}

View File

@@ -0,0 +1,51 @@
<?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.FakeIpConfigGroupDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.FakeIpConfigGroup">
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
<result column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
<result property="id" jdbcType="BIGINT" column="ID"/>
</resultMap>
<insert id="insert" parameterType="com.nis.domain.restful.FakeIpConfigGroup">
insert into FAKE_IP_CONFIG_GROUP (GROUP_ID, COMPILE_ID, IS_VALID,
OP_TIME,LAST_UPDATE,ID)
values (#{groupId,jdbcType=BIGINT}, #{compileId,jdbcType=BIGINT}, #{isValid,jdbcType=INTEGER},
#{opTime,jdbcType=TIMESTAMP},#{lastUpdate,jdbcType=TIMESTAMP},SEQ_CONFIG_GROUP.Nextval)
</insert>
<!--
<insert id="insertSelective" parameterType="com.nis.domain.restful.FakeIpConfigGroup">
insert into FAKE_IP_CONFIG_GROUP
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="groupId != null">
GROUP_ID,
</if>
<if test="compileId != null">
COMPILE_ID,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="groupId != null">
#{groupId,jdbcType=BIGINT},
</if>
<if test="compileId != null">
#{compileId,jdbcType=BIGINT},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=DATE},
</if>
</trim>
</insert>
-->
</mapper>

View File

@@ -0,0 +1,19 @@
package com.nis.web.dao;
import com.nis.domain.restful.FwqInfo;
/**
*
* @ClassName: FwqInfoDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:01:09
* @version V1.0
*/
@MyBatisDao
public interface FwqInfoDao extends CrudDao<FwqInfo>{
int delete(long id);
int insert(FwqInfo record);
int update(FwqInfo record);
}

View File

@@ -0,0 +1,106 @@
<?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.FwqInfoDao">
<resultMap id="fwqInfoResultMap" type="com.nis.domain.restful.FwqInfo">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="NAME" jdbcType="VARCHAR" property="name" />
<result column="ENTRANCE_ID" jdbcType="BIGINT" property="entranceId" />
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
</resultMap>
<sql id="Base_Column_List">
ID, NAME, ENTRANCE_ID, CZYID, OP_TIME,LAST_UPDATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="fwqInfoResultMap">
select
<include refid="Base_Column_List" />
from FWQ_INFO
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="delete" parameterType="java.lang.Long">
delete from FWQ_INFO
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.nis.domain.restful.FwqInfo">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_FWQ_INFO.Nextval as ID from DUAL
</selectKey>
-->
insert into FWQ_INFO (ID, NAME, ENTRANCE_ID,
CZYID, OP_TIME,LAST_UPDATE)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{entranceId,jdbcType=BIGINT},
#{czyid,jdbcType=BIGINT}, #{opTime,jdbcType=TIMESTAMP},#{lastUpdate,jdbcType=TIMESTAMP})
</insert>
<!--
<insert id="insertSelective" parameterType="com.nis.domain.restful.FwqInfo">
insert into FWQ_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="name != null">
NAME,
</if>
<if test="entranceId != null">
ENTRANCE_ID,
</if>
<if test="czyid != null">
CZYID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="entranceId != null">
#{entranceId,jdbcType=BIGINT},
</if>
<if test="czyid != null">
#{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
-->
<update id="update" parameterType="com.nis.domain.restful.FwqInfo">
update FWQ_INFO
<set>
<if test="name != null">
NAME = #{name,jdbcType=VARCHAR},
</if>
<if test="entranceId != null">
ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
</if>
<if test="czyid != null">
CZYID = #{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.FwqInfo">
update FWQ_INFO
set NAME = #{name,jdbcType=VARCHAR},
ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
CZYID = #{czyid,jdbcType=BIGINT},
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=BIGINT}
</update>
-->
</mapper>

View File

@@ -0,0 +1,27 @@
/**
* @Title: IntervalTimeSearchDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author zbc
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DjFlowControlStop;
/**
* @ClassName: IntervalTimeSearchDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
@MyBatisDao
public interface IntervalTimeSearchDao extends CrudDao<Serializable>{
List<DjFlowControlStop> findFlowControlStopPage(DjFlowControlStop entity);
}

View File

@@ -0,0 +1,44 @@
<?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.IntervalTimeSearchDao">
<!-- DJ_FLOWCONTROL_STOP -->
<sql id="flowControlStopProperty">
CFG_ID,SERVICE,ACTION,OP_TIME
</sql>
<resultMap id="DjFlowControlStopMap" type="com.nis.domain.restful.DjFlowControlStop">
<result column="CFG_ID" jdbcType="BIGINT" property="cfgId" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="action" jdbcType="INTEGER" property="action" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<select id="findFlowControlStopPage" parameterType="com.nis.domain.restful.DjFlowControlStop" resultMap="DjFlowControlStopMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="flowControlStopProperty"/>
</otherwise>
</choose>
FROM DJ_FLOWCONTROL_STOP
<where>
<if test="optStartTime != null and optStartTime !=''">
<![CDATA[AND OP_TIME >= to_date(#{optStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="optEndTime != null and optEndTime !=''">
<![CDATA[AND OP_TIME < to_date(#{optEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<!-- <if test="searchCfgId != null and searchCfgId !=''">
AND cfg_id =${searchCfgId}
</if> -->
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -0,0 +1,18 @@
package com.nis.web.dao;
import com.nis.domain.restful.IpLocationPublic;
import java.math.BigDecimal;
public interface IpLocationPublicDao extends CrudDao<IpLocationPublic>{
int deleteByPrimaryKey(long id);
int insert(IpLocationPublic record);
int insertSelective(IpLocationPublic record);
IpLocationPublic selectByPrimaryKey(long id);
int updateByPrimaryKeySelective(IpLocationPublic record);
int updateByPrimaryKey(IpLocationPublic record);
}

View File

@@ -0,0 +1,238 @@
<?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.IpLocationPublicDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.IpLocationPublic">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="IP_START" jdbcType="VARCHAR" property="ipStart" />
<result column="IP_END" jdbcType="VARCHAR" property="ipEnd" />
<result column="IP_START_NUM" jdbcType="BIGINT" property="ipStartNum" />
<result column="IP_END_NUM" jdbcType="BIGINT" property="ipEndNum" />
<result column="CONTINENT" jdbcType="VARCHAR" property="continent" />
<result column="COUNTRY" jdbcType="VARCHAR" property="country" />
<result column="PROVINCE" jdbcType="VARCHAR" property="province" />
<result column="CITY" jdbcType="VARCHAR" property="city" />
<result column="DISTRICT" jdbcType="VARCHAR" property="district" />
<result column="DESCRIPTION" jdbcType="VARCHAR" property="description" />
<result column="ISP" jdbcType="VARCHAR" property="isp" />
<result column="AREA_CODE" jdbcType="VARCHAR" property="areaCode" />
<result column="COUNTRY_ENGLISH" jdbcType="VARCHAR" property="countryEnglish" />
<result column="COUNTRY_CODE" jdbcType="VARCHAR" property="countryCode" />
<result column="LONGITUDE" jdbcType="VARCHAR" property="longitude" />
<result column="LATITUDE" jdbcType="VARCHAR" property="latitude" />
</resultMap>
<sql id="Base_Column_List">
ID, IP_START, IP_END, IP_START_NUM, IP_END_NUM, CONTINENT, COUNTRY, PROVINCE, CITY,
DISTRICT, DESCRIPTION, ISP, AREA_CODE, COUNTRY_ENGLISH, COUNTRY_CODE, LONGITUDE,
LATITUDE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from IP_LOCATION_PUBLIC
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from IP_LOCATION_PUBLIC
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.nis.domain.restful.IpLocationPublic">
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_IP_LOCATION_PUBLIC.Nextval as ID from DUAL
</selectKey>
insert into IP_LOCATION_PUBLIC (ID, IP_START, IP_END,
IP_START_NUM, IP_END_NUM, CONTINENT,
COUNTRY, PROVINCE, CITY,
DISTRICT, DESCRIPTION, ISP,
AREA_CODE, COUNTRY_ENGLISH, COUNTRY_CODE,
LONGITUDE, LATITUDE)
values (#{id,jdbcType=BIGINT}, #{ipStart,jdbcType=VARCHAR}, #{ipEnd,jdbcType=VARCHAR},
#{ipStartNum,jdbcType=BIGINT}, #{ipEndNum,jdbcType=BIGINT}, #{continent,jdbcType=VARCHAR},
#{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
#{district,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{isp,jdbcType=VARCHAR},
#{areaCode,jdbcType=VARCHAR}, #{countryEnglish,jdbcType=VARCHAR}, #{countryCode,jdbcType=VARCHAR},
#{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.nis.domain.restful.IpLocationPublic">
insert into IP_LOCATION_PUBLIC
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="ipStart != null">
IP_START,
</if>
<if test="ipEnd != null">
IP_END,
</if>
<if test="ipStartNum != null">
IP_START_NUM,
</if>
<if test="ipEndNum != null">
IP_END_NUM,
</if>
<if test="continent != null">
CONTINENT,
</if>
<if test="country != null">
COUNTRY,
</if>
<if test="province != null">
PROVINCE,
</if>
<if test="city != null">
CITY,
</if>
<if test="district != null">
DISTRICT,
</if>
<if test="description != null">
DESCRIPTION,
</if>
<if test="isp != null">
ISP,
</if>
<if test="areaCode != null">
AREA_CODE,
</if>
<if test="countryEnglish != null">
COUNTRY_ENGLISH,
</if>
<if test="countryCode != null">
COUNTRY_CODE,
</if>
<if test="longitude != null">
LONGITUDE,
</if>
<if test="latitude != null">
LATITUDE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="ipStart != null">
#{ipStart,jdbcType=VARCHAR},
</if>
<if test="ipEnd != null">
#{ipEnd,jdbcType=VARCHAR},
</if>
<if test="ipStartNum != null">
#{ipStartNum,jdbcType=BIGINT},
</if>
<if test="ipEndNum != null">
#{ipEndNum,jdbcType=BIGINT},
</if>
<if test="continent != null">
#{continent,jdbcType=VARCHAR},
</if>
<if test="country != null">
#{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
#{city,jdbcType=VARCHAR},
</if>
<if test="district != null">
#{district,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="isp != null">
#{isp,jdbcType=VARCHAR},
</if>
<if test="areaCode != null">
#{areaCode,jdbcType=VARCHAR},
</if>
<if test="countryEnglish != null">
#{countryEnglish,jdbcType=VARCHAR},
</if>
<if test="countryCode != null">
#{countryCode,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
#{longitude,jdbcType=VARCHAR},
</if>
<if test="latitude != null">
#{latitude,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.nis.domain.restful.IpLocationPublic">
update IP_LOCATION_PUBLIC
<set>
<if test="ipStart != null">
IP_START = #{ipStart,jdbcType=VARCHAR},
</if>
<if test="ipEnd != null">
IP_END = #{ipEnd,jdbcType=VARCHAR},
</if>
<if test="ipStartNum != null">
IP_START_NUM = #{ipStartNum,jdbcType=BIGINT},
</if>
<if test="ipEndNum != null">
IP_END_NUM = #{ipEndNum,jdbcType=BIGINT},
</if>
<if test="continent != null">
CONTINENT = #{continent,jdbcType=VARCHAR},
</if>
<if test="country != null">
COUNTRY = #{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
PROVINCE = #{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
CITY = #{city,jdbcType=VARCHAR},
</if>
<if test="district != null">
DISTRICT = #{district,jdbcType=VARCHAR},
</if>
<if test="description != null">
DESCRIPTION = #{description,jdbcType=VARCHAR},
</if>
<if test="isp != null">
ISP = #{isp,jdbcType=VARCHAR},
</if>
<if test="areaCode != null">
AREA_CODE = #{areaCode,jdbcType=VARCHAR},
</if>
<if test="countryEnglish != null">
COUNTRY_ENGLISH = #{countryEnglish,jdbcType=VARCHAR},
</if>
<if test="countryCode != null">
COUNTRY_CODE = #{countryCode,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
LONGITUDE = #{longitude,jdbcType=VARCHAR},
</if>
<if test="latitude != null">
LATITUDE = #{latitude,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.IpLocationPublic">
update IP_LOCATION_PUBLIC
set IP_START = #{ipStart,jdbcType=VARCHAR},
IP_END = #{ipEnd,jdbcType=VARCHAR},
IP_START_NUM = #{ipStartNum,jdbcType=BIGINT},
IP_END_NUM = #{ipEndNum,jdbcType=BIGINT},
CONTINENT = #{continent,jdbcType=VARCHAR},
COUNTRY = #{country,jdbcType=VARCHAR},
PROVINCE = #{province,jdbcType=VARCHAR},
CITY = #{city,jdbcType=VARCHAR},
DISTRICT = #{district,jdbcType=VARCHAR},
DESCRIPTION = #{description,jdbcType=VARCHAR},
ISP = #{isp,jdbcType=VARCHAR},
AREA_CODE = #{areaCode,jdbcType=VARCHAR},
COUNTRY_ENGLISH = #{countryEnglish,jdbcType=VARCHAR},
COUNTRY_CODE = #{countryCode,jdbcType=VARCHAR},
LONGITUDE = #{longitude,jdbcType=VARCHAR},
LATITUDE = #{latitude,jdbcType=VARCHAR}
where ID = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -0,0 +1,58 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.IpRegion;
/**
*
* @ClassName: IpRegionDao
* @Description: TODO(ip类域配置dao)
* @author (rkg)
* @date 2016年9月6日下午8:49:52
* @version V1.0
*/
@MyBatisDao
public interface IpRegionDao {
/**
* 保存ip类域配置信息,并返回主键id
*
* @param ipRegion
* ip类域配置
* @return
*/
public Long saveIpRegion(IpRegion ipRegion);
/**
* 根据主键id修改ip类域配置信息
*
* @param ipRegion
*/
public void updateIpRegion(IpRegion ipRegion);
/**
* 根据主键regionId查询ip域配置
*
* @param ipRegion
* @return
*/
public IpRegion queryIpRegionById(IpRegion ipRegion);
/**
* 根据groupId获取该分组下所有的ip类域配置
* @param tableName
* @param groupIdArr
* @return
*/
public List<IpRegion> queryIpRegionByGroupId(@Param("tableName")String tableName,@Param("groupIdArr")Long[] groupIdArr);
/**
* 往指定ip域表中批量添加数据
* @param tableName
* @param ipRegionList
*/
public void saveIpRegionBatch(@Param("tableName")String tableName,@Param("ipRegionList")List<IpRegion> ipRegionList);
}

View File

@@ -0,0 +1,221 @@
<?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.IpRegionDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.IpRegion">
<result column="REGION_ID" jdbcType="BIGINT" property="regionId" />
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
<result column="ADDR_TYPE" jdbcType="INTEGER" property="addrType" />
<result column="SRC_IP" jdbcType="VARCHAR" property="srcIp" />
<result column="MASK_SRC_IP" jdbcType="VARCHAR" property="maskSrcIp" />
<result column="SRC_PORT" jdbcType="VARCHAR" property="srcPort" />
<result column="MASK_SRC_PORT" jdbcType="VARCHAR" property="maskSrcPort" />
<result column="DST_IP" jdbcType="VARCHAR" property="dstIp" />
<result column="MASK_DST_IP" jdbcType="VARCHAR" property="maskDstIp" />
<result column="DST_PORT" jdbcType="VARCHAR" property="dstPort" />
<result column="MASK_DST_PORT" jdbcType="VARCHAR" property="maskDstPort" />
<result column="PROTOCOL" jdbcType="INTEGER" property="protocol" />
<result column="DIRECTION" jdbcType="INTEGER" property="direction" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
</resultMap>
<sql id="ipRegionSql">
REGION_ID,GROUP_ID,
ADDR_TYPE,SRC_IP,MASK_SRC_IP,SRC_PORT,MASK_SRC_PORT,DST_IP,
MASK_DST_IP,DST_PORT,MASK_DST_PORT,PROTOCOL,DIRECTION,IS_VALID,OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<select id="queryIpRegionById" parameterType="com.nis.domain.restful.IpRegion"
resultMap="BaseResultMap">
select
<include refid="ipRegionSql" />
from ${tableName} where REGION_ID = #{regionId,jdbcType=BIGINT}
</select>
<select id="queryIpRegionByGroupId" resultMap="BaseResultMap">
select
<include refid="ipRegionSql" />
from ${tableName} where GROUP_ID in
<foreach item="item" index="index" collection="groupIdArr" open="("
separator="," close=")">
#{item}
</foreach>
</select>
<insert id="saveIpRegionBatch">
<!-- insert /*+append*/ into ${tableName} -->
insert into ${tableName}
(REGION_ID,
GROUP_ID,
ADDR_TYPE,
SRC_IP,
MASK_SRC_IP,
SRC_PORT,
MASK_SRC_PORT,
DST_IP,
MASK_DST_IP,
DST_PORT,
MASK_DST_PORT,
PROTOCOL,
DIRECTION,
IS_VALID,
OP_TIME,LAST_UPDATE
<!-- ,PROC_SEQ -->
)
<foreach collection="ipRegionList" item="item" index="index" open="("
close=")" separator="union">
select
#{item.regionId,jdbcType=BIGINT},
#{item.groupId,jdbcType=BIGINT},
#{item.addrType,jdbcType=INTEGER},
#{item.srcIp,jdbcType=VARCHAR},
#{item.maskSrcIp,jdbcType=VARCHAR},
#{item.srcPort,jdbcType=VARCHAR},
#{item.maskSrcPort,jdbcType=VARCHAR},
#{item.dstIp,jdbcType=VARCHAR},
#{item.maskDstIp,jdbcType=VARCHAR},
#{item.dstPort,jdbcType=VARCHAR},
#{item.maskDstPort,jdbcType=VARCHAR},
#{item.protocol,jdbcType=INTEGER},
#{item.direction,jdbcType=INTEGER},
#{item.isValid,jdbcType=INTEGER},
#{item.opTime,jdbcType=TIMESTAMP},
sysdate
<!-- #{item.procSeq,jdbcType=BIGINT} -->
from dual
</foreach>
</insert>
<insert id="saveIpRegion" parameterType="com.nis.domain.restful.IpRegion">
<!-- <selectKey keyProperty="regionId" resultType="java.lang.Long" -->
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
<!-- select seq_regionId.nextval from dual -->
<!-- </selectKey> -->
insert into ${tableName}
(REGION_ID,
GROUP_ID,
ADDR_TYPE,
SRC_IP,
MASK_SRC_IP,
SRC_PORT,
MASK_SRC_PORT,
DST_IP,
MASK_DST_IP,
DST_PORT,
MASK_DST_PORT,
PROTOCOL,
DIRECTION,
IS_VALID,
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
OP_TIME
)
values
(#{regionId,jdbcType=BIGINT},
#{groupId,jdbcType=BIGINT},
#{addrType,jdbcType=INTEGER},
#{srcIp,jdbcType=VARCHAR},
#{maskSrcIp,jdbcType=VARCHAR},
#{srcPort,jdbcType=VARCHAR},
#{maskSrcPort,jdbcType=VARCHAR},
#{dstIp,jdbcType=VARCHAR},
#{maskDstIp,jdbcType=VARCHAR},
#{dstPort,jdbcType=VARCHAR},
#{maskDstPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{direction,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
#{opTime,jdbcType=TIMESTAMP}
)
</insert>
<update id="updateIpRegion" parameterType="com.nis.domain.restful.IpRegion">
UPDATE ${tableName}
<set>
<if test="isValid != null">
IS_VALID=#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where REGION_ID=#{regionId}
</update>
<!--
<update id="updateIpRegion" parameterType="com.nis.domain.restful.IpRegion">
UPDATE ${tableName}
<set>
<if test="groupId != null">
GROUP_ID=#{groupId,jdbcType=BIGINT},
</if>
<if test="addrType != null">
ADDR_TYPE=#{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null and srcIp !=''">
SRC_IP=#{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null and maskSrcIp !=''">
MASK_SRC_IP=#{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null and srcPort !=''">
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null and maskSrcPort !=''">
MASK_SRC_PORT=#{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null and dstIp !=''">
DST_IP=#{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null and maskDstIp !=''">
MASK_DST_IP=#{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null and dstPort !=''">
DST_PORT=#{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null and maskDstPort !=''">
MASK_DST_PORT=#{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
PROTOCOL=#{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
DIRECTION=#{direction,jdbcType=INTEGER},
</if>
<if test="isValid != null">
IS_VALID=#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
</if>
</set>
where REGION_ID=#{regionId}
</update>
-->
</mapper>

View File

@@ -0,0 +1,19 @@
package com.nis.web.dao;
import com.nis.domain.restful.JdjInfo;
/**
* @ClassName: JdjInfoDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:02:33
* @version V1.0
*/
@MyBatisDao
public interface JdjInfoDao extends CrudDao<JdjInfo>{
int delete(long id);
int insert(JdjInfo record);
int update(JdjInfo record);
}

View File

@@ -0,0 +1,135 @@
<?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.JdjInfoDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.JdjInfo">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="NAME" jdbcType="VARCHAR" property="name" />
<result column="FWQ_ID" jdbcType="BIGINT" property="fwqId" />
<result column="JC_IP" jdbcType="VARCHAR" property="jcIp" />
<result column="FD_IP" jdbcType="VARCHAR" property="fdIp" />
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
</resultMap>
<sql id="Base_Column_List">
ID, NAME, FWQ_ID, JC_IP, FD_IP, CZYID, OP_TIME,LAST_UPDATE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from JDJ_INFO
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="delete" parameterType="java.lang.Long">
delete from JDJ_INFO
where ID = #{id,jdbcType=BIGINT}
</delete>
<!--
<insert id="insert" parameterType="com.nis.domain.restful.JdjInfo">
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_JDJ_INFO.Nextval as ID from DUAL
</selectKey>
insert into JDJ_INFO (ID, NAME, FWQ_ID,
JC_IP, FD_IP, CZYID,
OP_TIME)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{fwqId,jdbcType=BIGINT},
#{jcIp,jdbcType=VARCHAR}, #{fdIp,jdbcType=VARCHAR}, #{czyid,jdbcType=BIGINT},
#{opTime,jdbcType=TIMESTAMP})
</insert>
-->
<insert id="insert" parameterType="com.nis.domain.restful.JdjInfo">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_JDJ_INFO.Nextval as ID from DUAL
</selectKey> -->
insert into JDJ_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="name != null">
NAME,
</if>
<if test="fwqId != null">
FWQ_ID,
</if>
<if test="jcIp != null">
JC_IP,
</if>
<if test="fdIp != null">
FD_IP,
</if>
<if test="czyid != null">
CZYID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="fwqId != null">
#{fwqId,jdbcType=BIGINT},
</if>
<if test="jcIp != null">
#{jcIp,jdbcType=VARCHAR},
</if>
<if test="fdIp != null">
#{fdIp,jdbcType=VARCHAR},
</if>
<if test="czyid != null">
#{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="update" parameterType="com.nis.domain.restful.JdjInfo">
update JDJ_INFO
<set>
<if test="name != null">
NAME = #{name,jdbcType=VARCHAR},
</if>
<if test="fwqId != null">
FWQ_ID = #{fwqId,jdbcType=BIGINT},
</if>
<if test="jcIp != null">
JC_IP = #{jcIp,jdbcType=VARCHAR},
</if>
<if test="fdIp != null">
FD_IP = #{fdIp,jdbcType=VARCHAR},
</if>
<if test="czyid != null">
CZYID = #{czyid,jdbcType=BIGINT},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.JdjInfo">
update JDJ_INFO
set NAME = #{name,jdbcType=VARCHAR},
FWQ_ID = #{fwqId,jdbcType=BIGINT},
JC_IP = #{jcIp,jdbcType=VARCHAR},
FD_IP = #{fdIp,jdbcType=VARCHAR},
CZYID = #{czyid,jdbcType=BIGINT},
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=BIGINT}
</update>
-->
</mapper>

View File

@@ -0,0 +1,32 @@
/**
* Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.nis.web.dao;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.stereotype.Component;
/**
* 标识MyBatis的DAO,方便{@link org.mybatis.spring.mapper.MapperScannerConfigurer}的扫描。
* @author thinkgem
* @version 2013-8-28
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Component
public @interface MyBatisDao {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
* @return the suggested component name, if any
*/
String value() default "";
}

View File

@@ -0,0 +1,62 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.NumRegion;
/**
*
* @ClassName: NumRegionDao
* @Description: TODO(数值类域配置dao)
* @author (rkg)
* @date 2016年9月6日下午8:50:11
* @version V1.0
*/
@MyBatisDao
public interface NumRegionDao {
/**
* 保存数值类域配置信息,并返回主键id
*
* @param numRegion
* 数值类域配置
* @return
*/
public Long saveNumRegion(NumRegion numRegion);
/**
* 根据主键id修改数值类域配置信息
*
* @param numRegion
* 数值类域配置
*/
public void updateNumRegion(NumRegion numRegion);
/**
* 根据主键regionId查询NumRegion
*
* @param numRegion
* @return
*/
public NumRegion queryNumRegionById(NumRegion numRegion);
/**
* 根据groupId获取该分组下所有的数值类域配置
*
* @param tableName获取表名
* @param groupIdArr
* @return
*/
public List<NumRegion> queryNumRegionByGroupId(@Param("tableName")String tableName,@Param("groupIdArr")Long[] groupIdArr);
/**
* 向数值域配置表中批量添加数据
* @param tableName
* @param numRegionList
*/
public void saveNumRegionBatch(@Param("tableName")String tableName,@Param("numRegionList")List<NumRegion> numRegionList);
}

View File

@@ -0,0 +1,134 @@
<?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.NumRegionDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.NumRegion">
<result column="REGION_ID" jdbcType="BIGINT" property="regionId" />
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
<result column="LOW_BOUNDARY" jdbcType="BIGINT" property="lowBoundary" />
<result column="UP_BOUNDARY" jdbcType="BIGINT" property="upBoundary" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
</resultMap>
<sql id="numRegionSql">
REGION_ID,GROUP_ID,LOW_BOUNDARY,UP_BOUNDARY,IS_VALID,OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<select id="queryNumRegionById" parameterType="com.nis.domain.restful.NumRegion"
resultMap="BaseResultMap">
select
<include refid="numRegionSql" />
from ${tableName} where REGION_ID = #{regionId ,jdbcType=BIGINT }
</select>
<select id="queryNumRegionByGroupId" resultMap="BaseResultMap">
select
<include refid="numRegionSql" />
from ${tableName} where GROUP_ID in
<foreach item="item" index="index" collection="groupIdArr" open="("
separator="," close=")">
#{item}
</foreach>
</select>
<insert id="saveNumRegionBatch">
<!-- insert /*+append*/ into ${tableName} -->
insert into ${tableName}
(REGION_ID ,
GROUP_ID ,
LOW_BOUNDARY ,
UP_BOUNDARY ,
IS_VALID ,
OP_TIME,LAST_UPDATE
<!-- ,PROC_SEQ -->
)
<foreach collection="numRegionList" item="item" index="index"
open="(" close=")" separator="union">
select
#{item.regionId,jdbcType=BIGINT},
#{item.groupId,jdbcType=BIGINT},
#{item.lowBoundary,jdbcType=BIGINT},
#{item.upBoundary,jdbcType=BIGINT},
#{item.isValid,jdbcType=INTEGER},
#{item.opTime,jdbcType=TIMESTAMP},
sysdate
<!-- ,#{item.procSeq,jdbcType=BIGINT} -->
from dual
</foreach>
</insert>
<insert id="saveNumRegion" parameterType="com.nis.domain.restful.NumRegion">
<!-- <selectKey keyProperty="regionId" resultType="java.lang.Long" -->
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
<!-- select seq_regionId.nextval from dual -->
<!-- </selectKey> -->
insert into ${tableName}
(REGION_ID ,
GROUP_ID ,
LOW_BOUNDARY ,
UP_BOUNDARY ,
IS_VALID ,
<if test="lastUpdate != null">
LAST_UPDATE,
</if>
OP_TIME
)
values
(#{regionId,jdbcType=BIGINT},
#{groupId,jdbcType=BIGINT},
#{lowBoundary,jdbcType=BIGINT},
#{upBoundary,jdbcType=BIGINT},
#{isValid,jdbcType=INTEGER},
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
#{opTime,jdbcType=TIMESTAMP}
)
</insert>
<update id="updateNumRegion" parameterType="com.nis.domain.restful.NumRegion">
UPDATE ${tableName}
<set>
<if test="isValid != null">
IS_VALID=#{isValid , jdbcType=INTEGER },
</if>
<if test="opTime != null">
OP_TIME= #{ opTime , jdbcType=TIMESTAMP },
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where REGION_ID=#{regionId}
</update>
<!--
<update id="updateNumRegion" parameterType="com.nis.domain.restful.NumRegion">
UPDATE ${tableName}
<set>
<if test="groupId != null">
GROUP_ID=#{groupId , jdbcType=BIGINT },
</if>
<if test="lowBoundary != null">
LOW_BOUNDARY=#{lowBoundary,jdbcType=BIGINT},
</if>
<if test="upBoundary != null">
UP_BOUNDARY=#{upBoundary,jdbcType=BIGINT},
</if>
<if test="isValid != null">
IS_VALID=#{isValid , jdbcType=INTEGER },
</if>
<if test="opTime != null">
OP_TIME= #{ opTime , jdbcType=TIMESTAMP },
</if>
</set>
where REGION_ID=#{regionId}
</update>
-->
</mapper>

View File

@@ -0,0 +1,25 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.ServicesRequestLog;
import com.nis.domain.restful.ServicesRequestLogBean;
/**
* @ClassName: JdjInfoDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:02:33
* @version V1.0
*/
@MyBatisDao
public interface ServicesRequestLogDao {
int insert(ServicesRequestLog record);
public void deleteById(Long id);
public void deleteAll();
public List<ServicesRequestLogBean> getAllLog(ServicesRequestLogBean requestLog);
}

View File

@@ -0,0 +1,164 @@
<?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.ServicesRequestLogDao">
<resultMap id="ServicesRequestLogMap" type="com.nis.domain.ServicesRequestLog">
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="OPERATOR" jdbcType="VARCHAR" property="operator" />
<result column="VERSION" jdbcType="VARCHAR" property="version" />
<result column="OPACTION" jdbcType="INTEGER" property="opAction" />
<result column="OPTIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="REQUEST_CONTENT" jdbcType="CLOB" property="requestContent" />
<result column="REQUEST_TIME" jdbcType="TIMESTAMP" property="requestTime" />
<result column="CONSUMER_TIME" jdbcType="BIGINT" property="consumerTime" />
<result column="REQUEST_IP" jdbcType="VARCHAR" property="requestIp" />
<result column="BUSINESS_CODE" jdbcType="INTEGER" property="businessCode" />
<result column="EXCEPTION_INFO" jdbcType="VARCHAR" property="exceptionInfo" />
<result column="SERVER_IP" jdbcType="VARCHAR" property="serverIp" />
</resultMap>
<sql id="Base_Column_List">
ID, OPERATOR, VERSION, OPACTION,OPTIME, REQUEST_CONTENT,
REQUEST_TIME,REQUEST_IP,
CONSUMER_TIME,BUSINESS_CODE,EXCEPTION_INFO,SERVER_IP
</sql>
<select id="getAllLog" parameterType="com.nis.domain.restful.ServicesRequestLogBean"
resultMap="ServicesRequestLogMap">
select
<include refid="Base_Column_List" />
from SERVICES_REQUEST_LOG
<where>
<if test="id != null">
AND ID = #{id}
</if>
<if test="operator != null and operator !=''">
AND operator = #{operator}
</if>
<if test="version != null and version !=''">
AND version = #{version}
</if>
<if test="opAction != null">
AND opAction = #{opAction}
</if>
<if test="opStartTime != null and opStartTime !=''">
<![CDATA[AND opTime >= to_date(#{opStartTime },'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="opEndTime != null and opEndTime !=''">
<![CDATA[AND opTime < to_date(#{opEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="requestContent != null and requestContent !=''">
AND REQUEST_CONTENT like '%'||#{requestContent}||'%'
</if>
<if test="requestStartTime != null and requestStartTime !=''">
<![CDATA[AND REQUEST_TIME >= to_date(#{requestStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="requestEndTime != null and requestEndTime !=''">
<![CDATA[AND REQUEST_TIME < to_date(#{requestEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="consumerTime != null">
AND CONSUMER_TIME = #{consumerTime}
</if>
<if test="requestIp != null and requestIp !=''">
AND REQUEST_IP like '%'||#{requestIp}||'%'
</if>
<if test="businessCode != null">
AND BUSINESS_CODE =#{businessCode}
</if>
<if test="exceptionInfo != null and exceptionInfo !=''">
AND EXCEPTION_INFO like '%'||#{exceptionInfo}||'%'
</if>
<if test="serverIp != null and serverIp !=''">
AND SERVER_IP like '%'||#{serverIp}||'%'
</if>
</where>
order by request_time desc
</select>
<!-- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from SERVICES_REQUEST_LOG where
ID = #{id,jdbcType=BIGINT} </select> -->
<delete id="deleteById" parameterType="java.lang.Long">
delete from
SERVICES_REQUEST_LOG
where ID = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteAll">
delete from
SERVICES_REQUEST_LOG
</delete>
<insert id="insert" parameterType="com.nis.domain.ServicesRequestLog">
insert into SERVICES_REQUEST_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="operator != null">
OPERATOR,
</if>
<if test="version != null">
VERSION,
</if>
<if test="opAction != null">
OPACTION,
</if>
<if test="opTime != null">
OPTIME,
</if>
<if test="requestContent != null">
REQUEST_CONTENT,
</if>
<if test="requestTime != null">
REQUEST_TIME,
</if>
<if test="consumerTime != null">
CONSUMER_TIME,
</if>
<if test="requestIp != null">
REQUEST_IP,
</if>
<if test="businessCode != null">
BUSINESS_CODE,
</if>
<if test="exceptionInfo != null">
EXCEPTION_INFO,
</if>
<if test="serverIp != null">
SERVER_IP,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
SEQ_SERVICES_REQUEST_LOG.Nextval,
<if test="operator != null">
#{operator,jdbcType=VARCHAR},
</if>
<if test="version != null">
#{version,jdbcType=VARCHAR},
</if>
<if test="opAction != null">
#{opAction,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="requestContent != null">
#{requestContent,jdbcType=CLOB},
</if>
<if test="requestTime != null">
#{requestTime,jdbcType=TIMESTAMP},
</if>
<if test="consumerTime != null">
#{consumerTime,jdbcType=BIGINT},
</if>
<if test="requestIp != null">
#{requestIp,jdbcType=VARCHAR},
</if>
<if test="businessCode != null">
#{businessCode,jdbcType=INTEGER},
</if>
<if test="exceptionInfo != null">
#{exceptionInfo,jdbcType=VARCHAR},
</if>
<if test="serverIp != null">
#{serverIp,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>

View File

@@ -0,0 +1,25 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.SrcIp;
@MyBatisDao
public interface SrcIpDao extends CrudDao<SrcIp> {
List<SrcIp> getIpInfo(@Param("ip") Long ipaddr);
int deleteByPrimaryKey(Integer seqId);
int insert(SrcIp record);
int insertSelective(SrcIp record);
SrcIp selectByPrimaryKey(Integer seqId);
int updateByPrimaryKeySelective(SrcIp record);
int updateByPrimaryKey(SrcIp record);
}

View File

@@ -0,0 +1,189 @@
<?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.SrcIpDao" >
<resultMap id="BaseResultMap" type="com.nis.domain.SrcIp" >
<id column="seq_id" property="seqId" jdbcType="INTEGER" />
<result column="ip_start_addr" property="ipStartAddr" jdbcType="INTEGER" />
<result column="ip_end_addr" property="ipEndAddr" jdbcType="INTEGER" />
<result column="ip_addr_range" property="ipAddrRange" jdbcType="INTEGER" />
<result column="ip_start_string" property="ipStartString" jdbcType="VARCHAR" />
<result column="ip_end_string" property="ipEndString" jdbcType="VARCHAR" />
<result column="port" property="port" jdbcType="INTEGER" />
<result column="isp_id" property="ispId" jdbcType="BIGINT" />
<result column="area_id" property="areaId" jdbcType="BIGINT" />
<result column="flag" property="flag" jdbcType="INTEGER" />
<result column="description" property="description" jdbcType="VARCHAR" />
<result column="yl1" property="yl1" jdbcType="INTEGER" />
<result column="yl2" property="yl2" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
seq_id, ip_start_addr, ip_end_addr, ip_addr_range, ip_start_string, ip_end_string,
port, isp_id, area_id, flag, description, yl1, yl2
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from src_ip
where seq_id = #{seqId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from src_ip
where seq_id = #{seqId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.nis.domain.SrcIp" >
insert into src_ip (seq_id, ip_start_addr, ip_end_addr,
ip_addr_range, ip_start_string, ip_end_string,
port, isp_id, area_id,
flag, description, yl1,
yl2)
values (#{seqId,jdbcType=INTEGER}, #{ipStartAddr,jdbcType=INTEGER}, #{ipEndAddr,jdbcType=INTEGER},
#{ipAddrRange,jdbcType=INTEGER}, #{ipStartString,jdbcType=VARCHAR}, #{ipEndString,jdbcType=VARCHAR},
#{port,jdbcType=INTEGER}, #{ispId,jdbcType=BIGINT}, #{areaId,jdbcType=BIGINT},
#{flag,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{yl1,jdbcType=INTEGER},
#{yl2,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.nis.domain.SrcIp" >
insert into src_ip
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="seqId != null" >
seq_id,
</if>
<if test="ipStartAddr != null" >
ip_start_addr,
</if>
<if test="ipEndAddr != null" >
ip_end_addr,
</if>
<if test="ipAddrRange != null" >
ip_addr_range,
</if>
<if test="ipStartString != null" >
ip_start_string,
</if>
<if test="ipEndString != null" >
ip_end_string,
</if>
<if test="port != null" >
port,
</if>
<if test="ispId != null" >
isp_id,
</if>
<if test="areaId != null" >
area_id,
</if>
<if test="flag != null" >
flag,
</if>
<if test="description != null" >
description,
</if>
<if test="yl1 != null" >
yl1,
</if>
<if test="yl2 != null" >
yl2,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="seqId != null" >
#{seqId,jdbcType=INTEGER},
</if>
<if test="ipStartAddr != null" >
#{ipStartAddr,jdbcType=INTEGER},
</if>
<if test="ipEndAddr != null" >
#{ipEndAddr,jdbcType=INTEGER},
</if>
<if test="ipAddrRange != null" >
#{ipAddrRange,jdbcType=INTEGER},
</if>
<if test="ipStartString != null" >
#{ipStartString,jdbcType=VARCHAR},
</if>
<if test="ipEndString != null" >
#{ipEndString,jdbcType=VARCHAR},
</if>
<if test="port != null" >
#{port,jdbcType=INTEGER},
</if>
<if test="ispId != null" >
#{ispId,jdbcType=BIGINT},
</if>
<if test="areaId != null" >
#{areaId,jdbcType=BIGINT},
</if>
<if test="flag != null" >
#{flag,jdbcType=INTEGER},
</if>
<if test="description != null" >
#{description,jdbcType=VARCHAR},
</if>
<if test="yl1 != null" >
#{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null" >
#{yl2,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.nis.domain.SrcIp" >
update src_ip
<set >
<if test="ipStartAddr != null" >
ip_start_addr = #{ipStartAddr,jdbcType=INTEGER},
</if>
<if test="ipEndAddr != null" >
ip_end_addr = #{ipEndAddr,jdbcType=INTEGER},
</if>
<if test="ipAddrRange != null" >
ip_addr_range = #{ipAddrRange,jdbcType=INTEGER},
</if>
<if test="ipStartString != null" >
ip_start_string = #{ipStartString,jdbcType=VARCHAR},
</if>
<if test="ipEndString != null" >
ip_end_string = #{ipEndString,jdbcType=VARCHAR},
</if>
<if test="port != null" >
port = #{port,jdbcType=INTEGER},
</if>
<if test="ispId != null" >
isp_id = #{ispId,jdbcType=BIGINT},
</if>
<if test="areaId != null" >
area_id = #{areaId,jdbcType=BIGINT},
</if>
<if test="flag != null" >
flag = #{flag,jdbcType=INTEGER},
</if>
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
</if>
<if test="yl1 != null" >
yl1 = #{yl1,jdbcType=INTEGER},
</if>
<if test="yl2 != null" >
yl2 = #{yl2,jdbcType=VARCHAR},
</if>
</set>
where seq_id = #{seqId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.nis.domain.SrcIp" >
update src_ip
set ip_start_addr = #{ipStartAddr,jdbcType=INTEGER},
ip_end_addr = #{ipEndAddr,jdbcType=INTEGER},
ip_addr_range = #{ipAddrRange,jdbcType=INTEGER},
ip_start_string = #{ipStartString,jdbcType=VARCHAR},
ip_end_string = #{ipEndString,jdbcType=VARCHAR},
port = #{port,jdbcType=INTEGER},
isp_id = #{ispId,jdbcType=BIGINT},
area_id = #{areaId,jdbcType=BIGINT},
flag = #{flag,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
yl1 = #{yl1,jdbcType=INTEGER},
yl2 = #{yl2,jdbcType=VARCHAR}
where seq_id = #{seqId,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,69 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.restful.StrRegion;
/**
*
* @ClassName: StrRegionDao
* @Description: TODO(字符串类域配置dao)
* @author (rkg)
* @date 2016年9月6日下午8:50:23
* @version V1.0
*/
@MyBatisDao
public interface StrRegionDao {
/**
* 根据主键id修改字符类域配置信息
*
* @param strRegion
* 字符类域配置
*/
public void updateStrRegion(StrRegion strRegion);
/**
* 根据主键regionId查询字符串域配置信息
*
* @param strRegion
* @return
*/
public StrRegion queryStrRegionById(StrRegion strRegion);
/**
* 根据groupId获取该分组下所有的字符串类域配置
* @param tableName
* @param groupIdArr
* @return
*/
public List<StrRegion> queryStrRegionByGroupId(@Param("tableName")String tableName,@Param("groupIdArr")Long[] groupIdArr);
/**
* 根据groupId获取该分组下所有的增强字符串类域配置
* @param tableName
* @param groupIdArr
* @return
*/
public List<StrRegion> queryStrStrongRegionByGroupId(@Param("tableName")String tableName,@Param("groupIdArr")Long[] groupIdArr);
/**
* 向字符串域中批量插入数据
*
* @param tableName
* @param strRegionList
*/
public void saveStrRegionBatch(@Param("tableName") String tableName,
@Param("strRegionList") List<StrRegion> strRegionList);
/**
* 向增强字符串域中批量插入数据
*
* @param tableName
* @param strRegionList
*/
public void saveStrStrongRegionBatch(@Param("tableName") String tableName,
@Param("strRegionList") List<StrRegion> strRegionList);
}

View File

@@ -0,0 +1,160 @@
<?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.StrRegionDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.StrRegion">
<result column="REGION_ID" jdbcType="BIGINT" property="regionId" />
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
<result column="DISTRICT" jdbcType="VARCHAR" property="district" />
<result column="KEYWORDS" jdbcType="VARCHAR" property="keywords" />
<result column="EXPR_TYPE" jdbcType="INTEGER" property="exprType" />
<result column="MATCH_METHOD" jdbcType="INTEGER" property="matchMethod" />
<result column="IS_HEXBIN" jdbcType="INTEGER" property="isHexbin" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
</resultMap>
<sql id="strRegionSql">
REGION_ID,
GROUP_ID,
KEYWORDS,
EXPR_TYPE,
MATCH_METHOD,
IS_HEXBIN,
IS_VALID,
OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<sql id="strStrongRegionSql">
REGION_ID,
GROUP_ID,
DISTRICT,
KEYWORDS,
EXPR_TYPE,
MATCH_METHOD,
IS_HEXBIN,
IS_VALID,
OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<select id="queryStrRegionById" parameterType="com.nis.domain.restful.StrRegion"
resultMap="BaseResultMap">
select
<include refid="strRegionSql" />
from ${tableName} where REGION_ID = #{regionId ,jdbcType=BIGINT }
</select>
<select id="queryStrStrongRegionByGroupId" resultMap="BaseResultMap">
select
<include refid="strStrongRegionSql" />
from ${tableName} where GROUP_ID in
<foreach item="item" index="index" collection="groupIdArr"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="queryStrRegionByGroupId" resultMap="BaseResultMap">
select
<include refid="strRegionSql" />
from ${tableName} where GROUP_ID in
<foreach item="item" index="index" collection="groupIdArr"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<insert id="saveStrRegionBatch">
insert into ${tableName}
(REGION_ID,
GROUP_ID,
KEYWORDS,
EXPR_TYPE,
MATCH_METHOD ,
IS_HEXBIN,
IS_VALID,
OP_TIME,LAST_UPDATE
<!-- ,PROC_SEQ -->
)
<foreach collection="strRegionList" item="item" index="index"
open="(" close=")" separator="union">
select
#{item.regionId,jdbcType=BIGINT},
#{item.groupId,jdbcType=BIGINT},
#{item.keywords,jdbcType=VARCHAR},
#{item.exprType,jdbcType=INTEGER},
#{item.matchMethod,jdbcType=INTEGER},
#{item.isHexbin,jdbcType=INTEGER},
#{item.isValid,jdbcType=INTEGER},
#{item.opTime,jdbcType=TIMESTAMP},
sysdate
<!-- ,#{item.procSeq,jdbcType=BIGINT} -->
from dual
</foreach>
</insert>
<insert id="saveStrStrongRegionBatch">
insert into ${tableName}
(REGION_ID,
GROUP_ID,
DISTRICT,
KEYWORDS,
EXPR_TYPE,
MATCH_METHOD ,
IS_HEXBIN,
IS_VALID,
OP_TIME,LAST_UPDATE
)
<foreach collection="strRegionList" item="item" index="index"
open="(" close=")" separator="union">
select
#{item.regionId,jdbcType=BIGINT},
#{item.groupId,jdbcType=BIGINT},
#{item.district,jdbcType=VARCHAR},
#{item.keywords,jdbcType=VARCHAR},
#{item.exprType,jdbcType=INTEGER},
#{item.matchMethod,jdbcType=INTEGER},
#{item.isHexbin,jdbcType=INTEGER},
#{item.isValid,jdbcType=INTEGER},
#{item.opTime,jdbcType=TIMESTAMP},
<!-- #{item.lastUpdate,jdbcType=TIMESTAMP}, -->
sysdate
from dual
</foreach>
</insert>
<update id="updateStrRegion" parameterType="com.nis.domain.restful.StrRegion">
UPDATE ${tableName}
<set>
<if test="isValid != null">
IS_VALID=#{isValid , jdbcType=INTEGER },
</if>
<if test="opTime != null">
OP_TIME= #{ opTime , jdbcType=TIMESTAMP },
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
</if>
</set>
where REGION_ID=#{regionId}
</update>
<!-- <update id="updateStrRegion" parameterType="com.nis.domain.restful.StrRegion">
UPDATE ${tableName} <set> <if test="groupId != null"> GROUP_ID =#{ groupId
, jdbcType=BIGINT }, </if> <if test="district != null and district !=''">
DISTRICT = #{ district , jdbcType=VARCHAR }, </if> <if test="keywords !=
null and keywords !=''"> KEYWORDS = #{ keywords , jdbcType=VARCHAR }, </if>
<if test="exprType != null"> EXPR_TYPE = #{ exprType , jdbcType=INTEGER },
</if> <if test="matchMethod != null"> MATCH_METHOD = #{ matchMethod , jdbcType=INTEGER
}, </if> <if test="isHexbin != null "> IS_HEXBIN = #{ isHexbin , jdbcType=INTEGER
}, </if> <if test="isValid != null"> IS_VALID=#{isValid , jdbcType=INTEGER
}, </if> <if test="opTime != null"> OP_TIME= #{ opTime , jdbcType=TIMESTAMP
}, </if> </set> where REGION_ID=#{regionId} </update> -->
</mapper>

View File

@@ -0,0 +1,11 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.SysArea;
@MyBatisDao
public interface SysAreaDao extends TreeDao<SysArea>{
List<SysArea> findByParentIdsLike(SysArea area);
}

View File

@@ -0,0 +1,133 @@
<?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.SysAreaDao" >
<resultMap id="BaseResultMap" type="com.nis.domain.SysArea" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="parent_id" property="parentId" jdbcType="INTEGER" />
<result column="parent_ids" property="parentIds" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="sort" property="sort" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="CHAR" />
<result column="remarks" property="remarks" jdbcType="VARCHAR" />
<result column="longitude" property="longitude" jdbcType="FLOAT" />
<result column="latitude" property="latitude" jdbcType="FLOAT" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, parent_id, parent_ids, name, sort, code, type, remarks, longitude, latitude, del_flag
</sql>
<sql id="areaColumns">
a.id,
a.parent_id AS "parent.id",
a.parent_ids,
a.code,
a.name,
a.sort,
a.type,
a.remarks,
a.longitude,
a.latitude,
a.del_flag,
p.name AS "parent.name",
p.parent_ids as "parent.parentIds"
</sql>
<sql id="areaJoins">
LEFT JOIN sys_area p ON p.id = a.parent_id
</sql>
<select id="get" resultType="sysArea">
SELECT
<include refid="areaColumns"/>
FROM sys_area a
<include refid="areaJoins"/>
WHERE a.id = #{id}
</select>
<select id="findAllList" resultType="sysArea">
SELECT
<include refid="areaColumns"/>
FROM sys_area a
<include refid="areaJoins"/>
WHERE a.type in (1,2,3,4) and a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code
</select>
<select id="findByParentIdsLike" resultType="sysArea">
SELECT
<include refid="areaColumns"/>
FROM sys_area a
<include refid="areaJoins"/>
WHERE a.type in (1,2,3,4) and a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.code
</select>
<insert id="insert" parameterType="sysArea" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO sys_area(
parent_id,
parent_ids,
code,
name,
sort,
type,
longitude,
latitude,
remarks,
del_flag
) VALUES (
#{parent.id},
#{parentIds},
#{code},
#{name},
#{sort},
#{type},
#{longitude},
#{latitude},
#{remarks},
#{delFlag}
)
</insert>
<update id="update">
UPDATE sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
code = #{code},
name = #{name},
sort = #{sort},
type = #{type},
longitude = #{longitude},
latitude = #{latitude},
remarks = #{remarks}
WHERE id = #{id}
</update>
<update id="updateParentIds">
UPDATE sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<update id="delete">
UPDATE sys_area SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
<if test="dbName == 'mssql'">'%,'+#{id}+',%'</if>
<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
</update>
</mapper>

View File

@@ -0,0 +1,32 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.SysDataDictionaryName;
@MyBatisDao
public interface SysDictDao extends CrudDao<SysDataDictionaryName> {
List<SysDataDictionaryName> findDicByName(@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL,@Param("modualName") String modualName);
List<SysDataDictionaryName> findDictList(SysDataDictionaryName sysDictName);
SysDataDictionaryName getDictById(@Param("DEL_FLAG_NORMAL")Integer DEL_FLAG_NORMAL,@Param("id") Integer id);
void insertDictName(SysDataDictionaryName sysDictName);
void updateDictName(SysDataDictionaryName sysDictName);
void insertDictItem(SysDataDictionaryItem sysDictitem);
void deleteDictItem(@Param("dictId")Integer dictId);
void deleteDictName(@Param("dictId")Integer dictId);
}

View File

@@ -0,0 +1,154 @@
<?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.SysDictDao" >
<resultMap id="dictResultMap" type="com.nis.domain.SysDataDictionaryName" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="module_name" property="moduleName" jdbcType="VARCHAR" />
<result column="mark" property="mark" jdbcType="VARCHAR" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="revision" property="revision" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
<result column="status" property="status" jdbcType="INTEGER" />
<collection property="dictItemList" ofType="SysDataDictionaryItem">
<id property="id" column="item_id"/>
<result property="itemCode" column="item_code"/>
<result property="itemValue" column="item_value"/>
<result property="itemDesc" column="item_desc"/>
<result property="itemSort" column="item_sort"/>
<result property="status" column="item_status"/>
<result property="type" column="type"/>
</collection>
</resultMap>
<sql id="Base_Column_List" >
id, module_name, mark, remark, revision, create_time, modify_time, status
</sql>
<sql id="dictColumns">
n.id,
n.module_name,
n.mark,
n.remark,
n.revision,
n.create_time,
n.modify_time,
n.status,
t.id as item_id,
t.item_code,
t.item_value,
t.item_desc,
t.item_sort,
t.status as item_status,
t.type
</sql>
<sql id="dictJoins">
LEFT JOIN sys_data_dictionary_item t ON t.dictionary_id = n.id and t.status= #{DEL_FLAG_NORMAL}
</sql>
<select id="findAllList" resultMap="dictResultMap">
SELECT
<include refid="dictColumns"/>
FROM sys_data_dictionary_name n
<include refid="dictJoins"/>
WHERE n.status = #{DEL_FLAG_NORMAL}
ORDER BY n.id,t.item_sort
</select>
<select id="findDicByName" resultMap="dictResultMap">
SELECT
<include refid="dictColumns"/>
FROM sys_data_dictionary_name n
<include refid="dictJoins"/>
WHERE n.status = #{DEL_FLAG_NORMAL} AND n.module_name = #{modualName}
ORDER BY n.id,t.item_sort
</select>
<select id="getDictById" resultMap="dictResultMap">
SELECT
<include refid="dictColumns"/>
FROM sys_data_dictionary_name n
<include refid="dictJoins"/>
WHERE n.status = #{DEL_FLAG_NORMAL} AND n.id = #{id}
</select>
<select id="findDictList" resultMap="dictResultMap" parameterType="com.nis.domain.SysDataDictionaryName">
SELECT * FROM sys_data_dictionary_name WHERE status=1
<if test="moduleName != null and moduleName != '' " >
AND module_name like '%${moduleName}%'
</if>
<if test="mark != null and mark != '' " >
AND mark like '%${mark}%'
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 插入词典标识信息 -->
<insert id="insertDictName" parameterType="com.nis.domain.SysDataDictionaryName" useGeneratedKeys="true" keyProperty="id" >
insert into sys_data_dictionary_name (module_name, mark,
remark, revision, create_time,
modify_time, status)
values ( #{moduleName,jdbcType=VARCHAR}, #{mark,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{revision,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{modifyTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
</insert>
<!-- 插入词典项信息 -->
<insert id="insertDictItem" parameterType="com.nis.domain.SysDataDictionaryItem" useGeneratedKeys="true" keyProperty="id" >
insert into sys_data_dictionary_item ( item_code, item_value,
item_desc, item_sort, status,
type, dictionary_id)
values (#{itemCode,jdbcType=VARCHAR}, #{itemValue,jdbcType=VARCHAR},
#{itemDesc,jdbcType=VARCHAR}, #{itemSort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{dictionaryId,jdbcType=INTEGER})
</insert>
<!-- 删除词典标识信息 -->
<delete id="deleteDictName" >
delete from sys_data_dictionary_name
where id = #{dictId}
</delete>
<!-- 删除词典项信息 -->
<delete id="deleteDictItem">
delete from sys_data_dictionary_item
where dictionary_id = #{dictId}
</delete>
<!-- 编辑词典标识信息 -->
<update id="updateDictName" parameterType="com.nis.domain.SysDataDictionaryName" >
update sys_data_dictionary_name
set module_name = #{moduleName,jdbcType=VARCHAR},
mark = #{mark,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
revision = #{revision,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,7 @@
package com.nis.web.dao;
import com.nis.domain.SysLog;
@MyBatisDao
public interface SysLogDao extends CrudDao<SysLog>{
}

View File

@@ -0,0 +1,62 @@
<?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.SysLogDao" >
<select id="findList" resultType="sysLog">
SELECT
a.*
FROM sys_log a
WHERE a.create_date BETWEEN #{beginDate} AND #{endDate}
<if test="title != null and title != ''">
AND a.title LIKE
<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{title}, '%')</if>
</if>
<if test="createBy != null and createBy != ''">
AND a.create_by = #{createBy}
</if>
<if test="requestUri != null and requestUri != ''">
AND a.request_uri LIKE
<if test="dbName == 'oracle'">'%'||#{requestUri}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{requestUri}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{requestUri}, '%')</if>
</if>
<if test="exception != null and exception != ''">
AND a.state = 0
</if>
ORDER BY a.create_date DESC
</select>
<insert id="insert" parameterType="sysLog" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO sys_log(
type,
title,
create_by,
create_date,
remote_addr,
user_agent,
request_uri,
method,
state,
consumer_time,
params,
exception
) VALUES (
#{type},
#{title},
#{createBy},
#{createDate},
#{remoteAddr},
#{userAgent},
#{requestUri},
#{method},
#{state},
#{consumerTime},
#{params},
#{exception}
)
</insert>
</mapper>

View File

@@ -0,0 +1,23 @@
package com.nis.web.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.SysMenu;
@MyBatisDao
public interface SysMenuDao extends CrudDao<SysMenu>{
List<SysMenu> findSysMenuByUserId(@Param("userId") Long userId);
List<SysMenu> findByParentIdsLike(SysMenu m);
void updateParentIds(SysMenu e);
void updateSort(SysMenu menu);
}

View File

@@ -0,0 +1,154 @@
<?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.SysMenuDao" >
<sql id="menuColumns">
a.id,
a.parent_id AS "parent.id",
a.parent_ids,
a.name,
a.href,
a.target,
a.icon,
a.sort,
a.is_show,
a.permission,
a.remarks,
a.create_by AS "createBy.id",
a.create_date,
a.update_by AS "updateBy.id",
a.update_date,
a.del_flag,
a.quick_action,
a.menu_bg,
p.name AS "parent.name"
</sql>
<sql id="menuJoins">
LEFT JOIN sys_menu p ON p.id = a.parent_id
</sql>
<select id="get" resultType="sysMenu">
SELECT
<include refid="menuColumns"/>
FROM sys_menu a
<include refid="menuJoins"/>
WHERE a.id = #{id}
</select>
<select id="findAllList" resultType="sysMenu">
SELECT
<include refid="menuColumns"/>
FROM sys_menu a
<include refid="menuJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.sort
</select>
<select id="findSysMenuByUserId" resultType="sysMenu">
SELECT
<include refid="menuColumns"/>
FROM sys_menu a
LEFT JOIN sys_menu p ON p.id = a.parent_id
WHERE a.del_flag = 1 AND a.id IN (
SELECT l.privilege_access_value
FROM sys_privilege l WHERE l.privilege_master='ROLE' AND l.privilege_access='1000' AND l.privilege_operation=1
AND l.privilege_master_value IN
( SELECT distinct(r.id) FROM sys_role r,sys_inter_user_role ur WHERE r.id = ur.role_id AND r.status=1 AND ur.user_id=#{userId} )
)
ORDER BY a.sort
</select>
<insert id="insert" parameterType="sysMenu" useGeneratedKeys="true" keyProperty="id">
INSERT INTO sys_menu(
parent_id,
parent_ids,
name,
href,
target,
icon,
sort,
is_show,
permission,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag
) VALUES (
#{parent.id},
#{parentIds},
#{name},
#{href},
#{target},
#{icon},
#{sort},
#{isShow},
#{permission},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag}
)
</insert>
<update id="update">
UPDATE sys_menu SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
name = #{name},
href = #{href},
target = #{target},
icon = #{icon},
sort = #{sort},
is_show = #{isShow},
permission = #{permission},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
</update>
<select id="findByParentIdsLike" resultType="sysMenu">
SELECT
a.id,
a.parent_id AS "parent.id",
a.parent_ids
FROM sys_menu a
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.sort
</select>
<update id="updateParentIds">
UPDATE sys_menu SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<update id="updateSort">
UPDATE sys_menu SET
sort = #{sort}
WHERE id = #{id}
</update>
<update id="delete">
UPDATE sys_menu SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
<if test="dbName == 'mssql'">'%,'+#{id}+',%'</if>
<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
</update>
</mapper>

View File

@@ -0,0 +1,32 @@
package com.nis.web.dao;
import java.util.List;
import java.util.Map;
import com.nis.domain.SysOffice;
@MyBatisDao
public interface SysOfficeDao extends TreeDao<SysOffice> {
int deleteByPrimaryKey(Integer id);
int insert(SysOffice record);
int insertSelective(SysOffice record);
SysOffice selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOffice record);
int updateByPrimaryKey(SysOffice record);
List<SysOffice> selectSysOffice(SysOffice sysOffice);
List<SysOffice> selectLowerDeptement(Map<String, Object> hmap);
List<SysOffice> selectOfficeForDeptment(Map map);
List<SysOffice> selectOfficeForLetter(Map<String, Object> hmap);
}

View File

@@ -0,0 +1,331 @@
<?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.SysOfficeDao" >
<resultMap id="OfficeResultMap" type="com.nis.domain.SysOffice" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="parent_id" property="parent.id" jdbcType="INTEGER" />
<result column="parent_ids" property="parentIds" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="sort" property="sort" jdbcType="INTEGER" />
<result column="area_id" property="area.id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="INTEGER" />
<result column="grade" property="grade" jdbcType="INTEGER" />
<result column="job_type" property="jobType" jdbcType="INTEGER" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="zip_code" property="zipCode" jdbcType="VARCHAR" />
<result column="master" property="master" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="fax" property="fax" jdbcType="VARCHAR" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="USEABLE" property="useable" jdbcType="INTEGER" />
<result column="PRIMARY_PERSON" property="primaryPerson.id" jdbcType="INTEGER" />
<result column="DEPUTY_PERSON" property="deputyPerson.id" jdbcType="INTEGER" />
<result column="remarks" property="remarks" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, parent_id, parent_ids, name, en_name, sort, area_id, code, type, grade, job_type, address,
zip_code, master, phone, fax, email, USEABLE, PRIMARY_PERSON, DEPUTY_PERSON, remarks,
del_flag, create_time
</sql>
<select id="selectByPrimaryKey" resultMap="OfficeResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from sys_office
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectSysOffice" resultMap="OfficeResultMap" parameterType="com.nis.domain.SysOffice" >
select
<include refid="Base_Column_List" />
from sys_office
where 1=1
<if test="id != null" >
and Id = #{id,jdbcType=INTEGER}
</if>
<if test="parent != null" >
and parent_id = #{parent.id,jdbcType=INTEGER}
</if>
<if test="parentIds != null" >
and parent_ids = #{parentIds,jdbcType=VARCHAR}
</if>
<if test="name != null" >
and name = #{name,jdbcType=VARCHAR}
</if>
<if test="area != null" >
and area_id = #{area.id,jdbcType=INTEGER}
</if>
<if test="code != null" >
and code = #{code,jdbcType=VARCHAR}
</if>
<if test="grade != null" >
and grade = #{grade,jdbcType=INTEGER}
</if>
<if test="address != null" >
and address = #{address,jdbcType=VARCHAR}
</if>
<if test="zipCode != null" >
and zip_code = #{zipCode,jdbcType=VARCHAR}
</if>
<if test="master != null" >
and master = #{master,jdbcType=VARCHAR}
</if>
<if test="phone != null" >
and phone = #{phone,jdbcType=VARCHAR}
</if>
<if test="fax != null" >
and fax = #{fax,jdbcType=VARCHAR}
</if>
<if test="email != null" >
and email = #{email,jdbcType=VARCHAR}
</if>
<if test="useable != null" >
and USEABLE = #{useable,jdbcType=INTEGER}
</if>
<if test="primaryPerson != null" >
and PRIMARY_PERSON = #{primaryPerson,jdbcType=INTEGER}
</if>
<if test="deputyPerson != null" >
and DEPUTY_PERSON = #{deputyPerson,jdbcType=INTEGER}
</if>
<if test="remarks != null" >
and remarks = #{remarks,jdbcType=VARCHAR}
</if>
<if test="delFlag != null" >
and del_flag = #{delFlag,jdbcType=INTEGER}
</if>
<if test="createTime != null" >
and create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
ORDER BY sort
</select>
<select id="selectOfficeForDeptment" resultMap="OfficeResultMap" parameterType="map" >
<if test="grade == 1">
SELECT *
FROM sys_office t1
WHERE ((TYPE = 3 AND grade = 1 ) OR (TYPE = 1 AND grade = 2)) and del_flag = #{delFlag}
ORDER BY sort
</if>
<if test="grade == 2 or grade == 3">
SELECT *
FROM sys_office
WHERE (
<if test="grandParentId != null ">
(
</if>
parent_id=#{parentId}
<if test="grandParentId != null ">
or parent_id=#{grandParentId} ) AND id !=#{parentId}
</if>
) and del_flag = #{delFlag}
ORDER BY sort
</if>
</select>
<select id="selectLowerDeptement" resultMap="OfficeResultMap" parameterType="map" >
SELECT * FROM sys_office WHERE ( parent_id=#{parentId} OR id =#{parentId} ) and del_flag = #{delFlag}
ORDER BY sort
</select>
<select id="selectOfficeForLetter" resultMap="OfficeResultMap" parameterType="map" >
<if test="grade == 1">
SELECT *
FROM sys_office
WHERE (TYPE = 2 OR TYPE = 1) AND grade = 2 and del_flag = #{delFlag}
ORDER BY sort
</if>
<if test="grade == 2">
SELECT *
FROM sys_office
WHERE parent_id=#{parentId} and del_flag = #{delFlag}
ORDER BY sort
</if>
</select>
<sql id="officeColumns">
a.id,
a.parent_id AS "parent.id",
a.parent_ids AS "parentIds",
a.area_id AS "area.id",
a.code,
a.name,
a.sort,
a.type,
a.grade,
a.job_type,
a.address,
a.zip_code,
a.master,
a.phone,
a.fax,
a.email,
a.remarks,
a.del_flag,
a.useable AS useable,
a.primary_person AS "primaryPerson.id",
a.deputy_person AS "deputyPerson.id",
p.name AS "parent.name",
ar.name AS "area.name",
ar.parent_ids AS "area.parentIds",
pp.name AS "primaryPerson.name",
dp.name AS "deputyPerson.name"
</sql>
<sql id="officeJoins">
LEFT JOIN sys_office p ON p.id = a.parent_id
LEFT JOIN sys_area ar ON ar.id = a.area_id
LEFT JOIN SYS_USER pp ON pp.id = a.primary_person
LEFT JOIN SYS_USER dp ON dp.id = a.deputy_person
</sql>
<select id="get" resultType="sysOffice">
SELECT
<include refid="officeColumns"/>
FROM sys_office a
<include refid="officeJoins"/>
WHERE a.id = #{id}
</select>
<select id="findList" resultType="sysOffice">
SELECT
<include refid="officeColumns"/>
FROM sys_office a
<include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<!-- 数据范围过滤 -->
${sqlMap.dsf}
OR a.id=#{currentUser.office.id}
ORDER BY a.code
</select>
<select id="findAllList" resultType="sysOffice">
SELECT
<include refid="officeColumns"/>
FROM sys_office a
<include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code
</select>
<select id="findByParentIdsLike" resultType="sysOffice">
SELECT
<include refid="officeColumns"/>
FROM sys_office a
<include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.code
</select>
<insert id="insert" parameterType="sysOffice" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO sys_office(
parent_id,
parent_ids,
area_id,
code,
name,
sort,
type,
grade,
job_type,
address,
zip_code,
master,
phone,
fax,
email,
remarks,
del_flag,
useable,
primary_person,
deputy_person,
create_time
) VALUES (
#{parent.id},
#{parentIds},
#{area.id},
#{code},
#{name},
#{sort},
#{type},
#{grade},
#{jobType},
#{address},
#{zipCode},
#{master},
#{phone},
#{fax},
#{email},
#{remarks},
#{delFlag},
#{useable},
#{primaryPerson.id},
#{deputyPerson.id},
#{createTime}
)
</insert>
<update id="updateParentIds">
UPDATE sys_office SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<update id="update">
UPDATE sys_office SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
area_id = #{area.id},
code = #{code},
name = #{name},
type = #{type},
grade = #{grade},
job_type = #{jobType},
address = #{address},
zip_code = #{zipCode},
master = #{master},
phone = #{phone},
fax = #{fax},
email = #{email},
remarks = #{remarks},
useable=#{useable},
primary_person=#{primaryPerson.id},
deputy_person=#{deputyPerson.id}
WHERE id = #{id}
</update>
<update id="delete">
UPDATE sys_office SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
<if test="dbName == 'mssql'">'%,'+#{id}+',%'</if>
<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
</update>
</mapper>

View File

@@ -0,0 +1,18 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.SysRole;
import com.nis.domain.SysUser;
@MyBatisDao
public interface SysRoleDao extends CrudDao<SysRole>{
SysRole getByName(SysRole r);
void insertRoleMenu(SysRole role);
void deleteRoleMenu(SysRole role);
List<SysUser> findUserByRole(SysRole role);
}

View File

@@ -0,0 +1,138 @@
<?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.SysRoleDao" >
<resultMap id="BaseResultMap" type="SysRole" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="NAME" property="name" jdbcType="VARCHAR" />
<result column="ROLE_TYPE" property="roleType" jdbcType="VARCHAR" />
<result column="DATA_SCOPE" property="dataScope" jdbcType="INTEGER" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="STATUS" property="status" jdbcType="INTEGER" />
<result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
<collection property="menuList" ofType="sysMenu">
<id property="id" column="menuList.id" />
</collection>
</resultMap>
<sql id="Base_Column_List" >
r.ID, r.NAME, r.ROLE_TYPE, r.DATA_SCOPE, r.REMARK, r.STATUS, r.CREATE_TIME
</sql>
<select id="get" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>,
rm.privilege_access_value AS "menuList.id"
FROM sys_role r
LEFT JOIN sys_privilege rm ON rm.privilege_master_value = r.id and rm.privilege_master='ROLE' and rm.privilege_access='1000'
WHERE r.id = #{id}
</select>
<select id="getByName" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_role r
WHERE r.name = #{name} AND r.status = #{DEL_FLAG_NORMAL}
</select>
<select id="findAllList" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_role r
WHERE r.status = #{DEL_FLAG_NORMAL}
ORDER BY r.id
</select>
<select id="findUserByRole" resultType="sysUser">
SELECT
u.id,
u.login_id,
u.name,
u.photo,
u.password,
u.email,
u.create_time,
u.status,
c.id AS "company.id",
c.name AS "company.name",
e.id AS "entity.id",
e.name AS "entity.name",
o.id AS "office.id",
o.name AS "office.name"
FROM sys_user u
JOIN sys_inter_user_role ir ON u.id=ir.user_id and ir.role_id=#{id}
LEFT JOIN sys_office c ON c.id=u.company_id AND c.useable=1
LEFT JOIN sys_office e ON e.id=u.entity_id AND e.useable=1
LEFT JOIN sys_office o ON o.id=u.office_id AND o.useable=1
WHERE u.status=1
</select>
<insert id="insert" parameterType="sysRole" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO sys_role(
name,
role_type,
data_scope,
create_time,
remark,
status
) VALUES (
#{name},
#{roleType},
#{dataScope},
#{createTime},
#{remark},
#{status}
)
</insert>
<update id="update">
UPDATE sys_role SET
name = #{name},
role_type = #{roleType},
data_scope = #{dataScope},
remark = #{remark}
WHERE id = #{id}
</update>
<insert id="insertRoleMenu">
INSERT INTO sys_privilege(
privilege_master,
privilege_master_value,
privilege_access,
privilege_access_value,
privilege_operation)
<foreach collection="menuList" item="menu" separator=" union all ">
SELECT 'ROLE',#{id},'1000',#{menu.id},1
<if test="dbName != 'mssql'">
FROM dual
</if>
</foreach>
</insert>
<delete id="deleteRoleMenu">
DELETE FROM sys_privilege WHERE privilege_master='ROLE' and privilege_master_value = #{id}
</delete>
<update id="delete">
UPDATE sys_role SET
status = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,10 @@
package com.nis.web.dao;
import com.nis.domain.restful.SystemFunStatus;
@MyBatisDao
public interface SystemFunStatusDao extends CrudDao<SystemFunStatus> {
int insert(SystemFunStatus record);
int update(SystemFunStatus record);
}

View File

@@ -0,0 +1,53 @@
<?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.SystemFunStatusDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.SystemFunStatus">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="proc_seq" jdbcType="BIGINT" property="procSeq" />
<result column="function" jdbcType="BIGINT" property="function" />
<result column="back_data" jdbcType="BIGINT" property="backData" />
<result column="effective_range" jdbcType="VARCHAR" property="effectiveRange" />
<result column="active_sys" jdbcType="INTEGER" property="activeSys" />
<result column="is_valid" jdbcType="INTEGER" property="isValid" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<insert id="insert" parameterType="com.nis.domain.restful.SystemFunStatus">
insert into SYSTEM_FUN_STATUS
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="function != null">FUNCTION,</if>
<if test="backData != null">BACK_DATA,</if>
<if test="effectiveRange != null">EFFECTIVE_RANGE,</if>
<if test="activeSys != null">ACTIVE_SYS,</if>
<if test="isValid != null">IS_VALID,</if>
<if test="opTime != null">OP_TIME,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="function != null">#{function,jdbcType=BIGINT},</if>
<if test="backData != null">#{backData,jdbcType=BIGINT},</if>
<if test="effectiveRange != null">#{effectiveRange,jdbcType=VARCHAR},</if>
<if test="activeSys != null">#{activeSys,jdbcType=INTEGER},</if>
<if test="isValid != null">#{isValid,jdbcType=INTEGER},</if>
<if test="opTime != null">#{opTime,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="update" parameterType="com.nis.domain.restful.SystemFunStatus">
update SYSTEM_FUN_STATUS
<set>
<if test="function != null">FUNCTION = #{function,jdbcType=BIGINT},</if>
<if test="backData != null">BACK_DATA = #{backData,jdbcType=BIGINT},</if>
<if test="effectiveRange != null">EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},</if>
<if test="activeSys != null">ACTIVE_SYS = #{activeSys,jdbcType=INTEGER},</if>
<if test="isValid != null">IS_VALID = #{isValid,jdbcType=INTEGER},</if>
<if test="opTime != null">OP_TIME = #{opTime,jdbcType=TIMESTAMP},</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -0,0 +1,29 @@
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.TreeEntity;
/**
* DAO支持类实现
* @author ThinkGem
* @version 2014-05-16
* @param <T>
*/
public interface TreeDao<T extends TreeEntity<T>> extends CrudDao<T> {
/**
* 找到所有子节点
* @param entity
* @return
*/
public List<T> findByParentIdsLike(T entity);
/**
* 更新所有父节点字段
* @param entity
* @return
*/
public int updateParentIds(T entity);
}

View File

@@ -0,0 +1,69 @@
package com.nis.web.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.SysUser;
@MyBatisDao
public interface UserDao extends CrudDao<SysUser> {
/**
* 通过主键ID获取相关用户不包含密码
* @param id
* @return
*/
SysUser getUserById(@Param("id") Long id);
/**
* 通过登录账户获取相关用户,不包含密码
* @param loginName
* @return
*/
SysUser getUserByLoginName(@Param("loginName") String loginName);
/**
* 删除用户角色关联数据
* @param user id
* @return
*/
public int deleteUserRole(Long id);
/**
* 查询用户附带关联:部门、角色
* @param user
* @return
*/
SysUser getUserWithRelation(SysUser user);
void insertUserRole(SysUser user);
public int deleteUserOffice(Long id);
void insertUserOffice(SysUser user);
List<SysUser> findUserByRoleId(Long id);
List<SysUser> findUserByOfficeId(Long id);
void removeUserInRole(@Param("userId") Long userId, @Param("roleId") Long roleId);
void updateUserInfo(SysUser user);
void updatePasswordById(SysUser user);
List<Map> findDeptLeader(Integer DeptementId);
int officeIsExistOfCompany(@Param("officeId") Long officeId, @Param("companyId") Long companyId);
}

Some files were not shown because too many files have changed in this diff Show More