1286 lines
51 KiB
XML
1286 lines
51 KiB
XML
<?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.configuration.FileTransferCfgDao" >
|
|
|
|
<resultMap id="CfgIndexInfoMap" type="com.nis.domain.configuration.CfgIndexInfo" >
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="action" property="action" jdbcType="INTEGER" />
|
|
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
|
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
|
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
|
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
|
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
|
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
|
<result column="do_blacklist" property="doBlackList" jdbcType="INTEGER" />
|
|
</resultMap>
|
|
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
|
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
|
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
|
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
|
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
|
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
|
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
|
<result column="direction" property="direction" jdbcType="INTEGER" />
|
|
<result column="protocol" property="protocol" jdbcType="INTEGER" />
|
|
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
|
|
<result column="action" property="action" jdbcType="INTEGER" />
|
|
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
|
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
|
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
|
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
<resultMap id="complexCfgMap" type="com.nis.domain.configuration.ComplexkeywordCfg" >
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
|
<result column="district" property="district" jdbcType="VARCHAR" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="action" property="action" jdbcType="INTEGER" />
|
|
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
|
<result column="expr_type " property="exprType" jdbcType="INTEGER" />
|
|
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
|
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
<resultMap id="digestCfgMap" type="com.nis.domain.configuration.FileDigestCfg" >
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="raw_len" property="rawLen" jdbcType="BIGINT" />
|
|
<result column="digest" property="digest" jdbcType="VARCHAR" />
|
|
<result column="cfgds_level" property="cfgdsLevel" jdbcType="INTEGER" />
|
|
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
|
|
<result column="action" property="action" jdbcType="INTEGER" />
|
|
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
|
</resultMap>
|
|
<resultMap id="stringCfgMap" type="com.nis.domain.configuration.BaseStringCfg" >
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="action" property="action" jdbcType="INTEGER" />
|
|
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
|
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
|
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
|
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
|
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
|
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
|
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
|
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
|
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
|
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
|
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
|
<result column="expr_type " property="exprType" jdbcType="INTEGER" />
|
|
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
|
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
|
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
|
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
|
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
|
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
|
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
<sql id="ConfigIndex_Column" >
|
|
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
|
|
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
|
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
|
|
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.do_log,
|
|
a.user_region1,a.user_region2,a.user_region3,a.user_region4,a.user_region5,
|
|
a.do_blacklist
|
|
</sql>
|
|
<sql id="IpCfg_Column" >
|
|
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
|
,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address
|
|
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
|
|
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
|
|
a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable
|
|
,a.area_effective_ids,a.function_id,a.cfg_region_code,
|
|
a.user_region1,a.user_region2,a.user_region3,a.user_region4,a.user_region5
|
|
</sql>
|
|
<sql id="StrCfg_Column" >
|
|
a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type,
|
|
a.action,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id,a.edit_time, a.auditor_id,
|
|
a.audit_time,a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
|
a.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code,
|
|
a.user_region1,a.user_region2,a.user_region3,a.user_region4,a.user_region5
|
|
</sql>
|
|
<sql id="ComplexCfg_Column" >
|
|
a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type,a.district,
|
|
a.action,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id,a.edit_time, a.auditor_id,
|
|
a.audit_time,a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
|
a.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
|
|
</sql>
|
|
<sql id="DigestCfg_Column" >
|
|
a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.file_url,a.ACTION,a.IS_VALID,a.IS_AUDIT,
|
|
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
|
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,a.DO_LOG,
|
|
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,cfg_type,cfg_region_code
|
|
</sql>
|
|
<select id="getFtpList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
|
SELECT
|
|
<include refid="ConfigIndex_Column" />
|
|
<trim prefix="," prefixOverrides=",">
|
|
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
|
,ri.request_title as requestName
|
|
</trim>
|
|
FROM cfg_index_info a
|
|
left join sys_user s on a.creator_id=s.id
|
|
left join sys_user e on a.editor_id=e.id
|
|
left join sys_user u on a.auditor_id=u.id
|
|
left join request_info ri on a.request_id=ri.id
|
|
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="page !=null and page.where != null and page.where != ''">
|
|
AND ${page.where}
|
|
</if>
|
|
<if test="cfgId != null">
|
|
AND a.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="cfgDesc != null and cfgDesc != ''">
|
|
AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="action != null">
|
|
AND a.ACTION=#{action,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid != null">
|
|
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid == null">
|
|
AND a.IS_VALID != -1
|
|
</if>
|
|
<if test="isAudit != null">
|
|
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="creatorName != null and creatorName != ''">
|
|
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="editorName != null and editorName != ''">
|
|
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="auditorName != null and auditorName != ''">
|
|
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="serviceId != null">
|
|
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="requestId != null">
|
|
AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="compileId != null">
|
|
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isAreaEffective != null">
|
|
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="classify != null and classify != ''">
|
|
AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="attribute != null and attribute != ''">
|
|
AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="lable != null and lable != ''">
|
|
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
|
AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="ipPort!=null">
|
|
AND a.compile_id in (select t.compile_id from ip_port_cfg t
|
|
<where>
|
|
and t.protocol_id=7
|
|
<if test="ipPort.srcIpAddress != null and ipPort.srcIpAddress != ''">
|
|
and t.src_ip_address =#{ipPort.srcIpAddress,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="ipPort.srcPort != null and ipPort.srcPort != ''">
|
|
and t.src_port =#{ipPort.srcPort,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="ipPort.destIpAddress != null and ipPort.destIpAddress != ''">
|
|
and t.dest_ip_address =#{ipPort.destIpAddress,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="ipPort.destPort != null and ipPort.destPort != ''">
|
|
and t.dest_port =#{ipPort.destPort,jdbcType=VARCHAR}
|
|
</if>
|
|
</where>
|
|
)
|
|
</if>
|
|
<if test="searchKeywords != null and searchKeywords !=''">
|
|
AND a.compile_id in (SELECT d.compile_id FROM ftp_keyword_cfg d WHERE
|
|
d.cfg_keywords LIKE concat(concat('%',#{searchKeywords,jdbcType=VARCHAR}),'%')
|
|
)
|
|
</if>
|
|
<if test="ntcSubscribeIdCfg != null">
|
|
AND a.compile_id in (select f.compile_id from ntc_subscribe_id_cfg f
|
|
<where>
|
|
<if test="ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''">
|
|
and f.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="compileId != null">
|
|
and f.compile_id =#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
</where>
|
|
)
|
|
</if>
|
|
<!-- 数据范围过滤 -->
|
|
${sqlMap.dsf}
|
|
</trim>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY a.is_audit,a.CFG_ID desc
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
<select id="getCfgIndexInfo" resultMap="CfgIndexInfoMap">
|
|
SELECT
|
|
<include refid="ConfigIndex_Column" />
|
|
FROM cfg_index_info a
|
|
<where>
|
|
<if test="cfgId !=null">
|
|
CFG_ID = #{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="compileId != null">
|
|
AND COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getIpPortList" resultMap="ipPortMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="IpCfg_Column" />
|
|
FROM ip_port_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
|
</select>
|
|
|
|
<!-- ftp关键字查询 -->
|
|
<select id="getFtpKeywordList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="StrCfg_Column" />
|
|
FROM ftp_keyword_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
|
<if test="cfgType != null and cfgType != ''">
|
|
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
|
|
</if>
|
|
</select>
|
|
<!-- insert cfgIndexInfox -->
|
|
<insert id="saveCfgIndex" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into cfg_index_info(
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
do_log,
|
|
user_region1,
|
|
user_region2,
|
|
user_region3,
|
|
user_region4,
|
|
user_region5,
|
|
do_blacklist
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{doLog,jdbcType=INTEGER},
|
|
#{userRegion1,jdbcType=VARCHAR},
|
|
#{userRegion2,jdbcType=VARCHAR},
|
|
#{userRegion3,jdbcType=VARCHAR},
|
|
#{userRegion4,jdbcType=VARCHAR},
|
|
#{userRegion5,jdbcType=VARCHAR},
|
|
#{doBlackList,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
<!-- insert ip_port_cfg表信息 -->
|
|
<insert id="saveIpPortCfg" parameterType="com.nis.domain.configuration.IpPortCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into ip_port_cfg (
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
ip_type,
|
|
src_ip_address,
|
|
ip_pattern,
|
|
port_pattern,
|
|
src_port,
|
|
protocol,
|
|
protocol_id,
|
|
direction,
|
|
dest_port,
|
|
dest_ip_address,
|
|
cfg_type,
|
|
cfg_region_code,
|
|
user_region1,
|
|
user_region2,
|
|
user_region3,
|
|
user_region4,
|
|
user_region5
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{ipType,jdbcType=INTEGER},
|
|
#{srcIpAddress,jdbcType=VARCHAR},
|
|
#{ipPattern,jdbcType=INTEGER},
|
|
#{portPattern,jdbcType=INTEGER},
|
|
#{srcPort,jdbcType=VARCHAR},
|
|
#{protocol,jdbcType=INTEGER},
|
|
#{protocolId,jdbcType=INTEGER},
|
|
#{direction,jdbcType=INTEGER},
|
|
#{destPort,jdbcType=VARCHAR},
|
|
#{destIpAddress,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{userRegion1,jdbcType=VARCHAR},
|
|
#{userRegion2,jdbcType=VARCHAR},
|
|
#{userRegion3,jdbcType=VARCHAR},
|
|
#{userRegion4,jdbcType=VARCHAR},
|
|
#{userRegion5,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
<update id="updateCfgIndex" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
|
update cfg_index_info
|
|
<set >
|
|
<trim suffixOverrides=",">
|
|
<if test="cfgDesc != null and cfgDesc != ''" >
|
|
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="action != null" >
|
|
action = #{action,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isValid != null" >
|
|
is_valid = #{isValid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAudit != null" >
|
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="creatorId != null" >
|
|
creator_id = #{creatorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="createTime != null and createTime != ''" >
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="editorId != null" >
|
|
editor_id = #{editorId,jdbcType=INTEGER},
|
|
</if>
|
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
<if test="serviceId != null" >
|
|
service_id = #{serviceId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="requestId != null" >
|
|
request_id = #{requestId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAreaEffective != null" >
|
|
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="classify != null and classify != ''" >
|
|
classify = #{classify,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="attribute != null and attribute != ''" >
|
|
attribute = #{attribute,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="lable != null and lable != ''" >
|
|
lable = #{lable,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="areaEffectiveIds != null" >
|
|
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="functionId != null" >
|
|
function_id = #{functionId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="doLog != null" >
|
|
do_log = #{doLog,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="doBlackList != null">
|
|
do_blacklist = #{doBlackList,jdbcType=INTEGER}
|
|
</if>
|
|
</trim>
|
|
</set>
|
|
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
|
</update>
|
|
|
|
<update id="updateCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
|
|
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},
|
|
editor_id = #{editorId,jdbcType=INTEGER} ,
|
|
edit_time = #{editTime,jdbcType=TIMESTAMP}
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="cfgId !=null ">
|
|
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="compileId !=null ">
|
|
AND compile_id = #{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
and function_id=#{functionId,jdbcType=INTEGER}
|
|
</trim>
|
|
</update>
|
|
<update id="auditCfg" parameterType="com.nis.domain.configuration.BaseCfg">
|
|
update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER},
|
|
auditor_id = #{auditorId,jdbcType=INTEGER},
|
|
audit_time = #{auditTime,jdbcType=TIMESTAMP}
|
|
<if test="isValid != null" >
|
|
,is_valid = #{isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="cfgId !=null ">
|
|
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="compileId !=null ">
|
|
AND compile_id = #{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
and function_id=#{functionId,jdbcType=INTEGER}
|
|
</trim>
|
|
|
|
</update>
|
|
|
|
<!-- insert ftp_keyword_cfg表信息 -->
|
|
<insert id="saveFtpKeywordCfg" parameterType="com.nis.domain.configuration.FtpKeywordCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into ftp_keyword_cfg (
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
cfg_keywords,
|
|
cfg_type,
|
|
cfg_region_code,
|
|
expr_type,
|
|
match_method,
|
|
is_hexbin
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
|
|
<select id="getP2pList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
|
SELECT
|
|
<include refid="ConfigIndex_Column" />
|
|
<trim prefix="," prefixOverrides=",">
|
|
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
|
,ri.request_title as requestName
|
|
</trim>
|
|
FROM cfg_index_info a
|
|
left join sys_user s on a.creator_id=s.id
|
|
left join sys_user e on a.editor_id=e.id
|
|
left join sys_user u on a.auditor_id=u.id
|
|
left join request_info ri on a.request_id=ri.id
|
|
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="page !=null and page.where != null and page.where != ''">
|
|
AND ${page.where}
|
|
</if>
|
|
<if test="cfgId != null">
|
|
AND a.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="cfgDesc != null and cfgDesc != ''">
|
|
AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="action != null">
|
|
AND a.ACTION=#{action,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid != null">
|
|
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid == null">
|
|
AND a.IS_VALID != -1
|
|
</if>
|
|
<if test="isAudit != null">
|
|
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="creatorName != null and creatorName != ''">
|
|
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="editorName != null and editorName != ''">
|
|
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="auditorName != null and auditorName != ''">
|
|
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="serviceId != null">
|
|
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="requestId != null">
|
|
AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="compileId != null">
|
|
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isAreaEffective != null">
|
|
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="classify != null and classify != ''">
|
|
AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="attribute != null and attribute != ''">
|
|
AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="lable != null and lable != ''">
|
|
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
|
AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="ipPort!=null">
|
|
AND a.compile_id in (select t.compile_id from ip_port_cfg t
|
|
<where>
|
|
<if test="ipPort.srcIpAddress != null and ipPort.srcIpAddress != ''">
|
|
and t.src_ip_address =#{ipPort.srcIpAddress,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="ipPort.srcPort != null and ipPort.srcPort != ''">
|
|
and t.src_port =#{ipPort.srcPort,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="ipPort.destIpAddress != null and ipPort.destIpAddress != ''">
|
|
and t.dest_ip_address =#{ipPort.destIpAddress,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="ipPort.destPort != null and ipPort.destPort != ''">
|
|
and t.dest_port =#{ipPort.destPort,jdbcType=VARCHAR}
|
|
</if>
|
|
</where>
|
|
)
|
|
</if>
|
|
<if test="p2pHash!=null">
|
|
AND a.compile_id in (select h.compile_id from p2p_hash_cfg h
|
|
<where>
|
|
<if test="p2pHash.cfgKeywords != null and p2pHash.cfgKeywords != ''">
|
|
REPLACE(h.cfg_keywords,'***and***','|') like concat(concat('%',#{p2pHash.cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
</where>
|
|
)
|
|
</if>
|
|
<if test="p2pKeyword!=null">
|
|
AND a.compile_id in (select k.compile_id from p2p_keyword_cfg k
|
|
<where>
|
|
<if test="p2pKeyword.cfgKeywords != null and p2pKeyword.cfgKeywords != ''">
|
|
REPLACE(k.cfg_keywords,'***and***','|') like concat(concat('%',#{p2pKeyword.cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
</where>
|
|
)
|
|
</if>
|
|
<if test="ntcSubscribeIdCfg!=null">
|
|
AND a.compile_id in (select s.compile_id from ntc_subscribe_id_cfg s
|
|
<where>
|
|
<if test="ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''">
|
|
and s.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
|
|
</where>
|
|
)
|
|
</if>
|
|
<!-- 数据范围过滤 -->
|
|
${sqlMap.dsf}
|
|
</trim>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY a.is_audit,a.CFG_ID desc
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
<select id="getP2pHashList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="StrCfg_Column" />
|
|
FROM p2p_hash_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
|
<if test="cfgType != null and cfgType != ''">
|
|
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getP2pKeywordList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="StrCfg_Column" />
|
|
FROM p2p_keyword_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
|
<if test="cfgType != null and cfgType != ''">
|
|
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getP2pSubscribeidList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="StrCfg_Column" />
|
|
FROM ntc_subscribe_id_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
|
<if test="cfgType != null and cfgType != ''">
|
|
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- insert p2p_hash_cfg表信息 -->
|
|
<insert id="saveP2pHashCfg" parameterType="com.nis.domain.configuration.P2pHashCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into p2p_hash_cfg (
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
cfg_keywords,
|
|
cfg_type,
|
|
cfg_region_code,
|
|
expr_type,
|
|
match_method,
|
|
is_hexbin
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
|
|
<!-- insert p2p_keyword_cfg表信息 -->
|
|
<insert id="saveP2pKeywordCfg" parameterType="com.nis.domain.configuration.P2pKeywordCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into p2p_keyword_cfg (
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
cfg_keywords,
|
|
cfg_type,
|
|
cfg_region_code,
|
|
expr_type,
|
|
match_method,
|
|
is_hexbin
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
|
|
<!-- insert p2p ntc_subscribe_id_cfg表信息 -->
|
|
<insert id="saveP2pSubscribeIdCfg" parameterType="com.nis.domain.configuration.P2pKeywordCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into ntc_subscribe_id_cfg (
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
cfg_keywords,
|
|
cfg_type,
|
|
cfg_region_code,
|
|
expr_type,
|
|
match_method,
|
|
is_hexbin
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
|
|
<!-- 文件摘要配置 -->
|
|
<insert id="saveFileDigestCfg" parameterType="com.nis.domain.configuration.FileDigestCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into file_digest_cfg(
|
|
CFG_DESC,
|
|
RAW_LEN,
|
|
DIGEST,
|
|
CFDS_LEVEL,
|
|
FILE_URL,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
cfg_type,
|
|
cfg_region_code
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{rawLen,jdbcType=BIGINT},
|
|
#{digest,jdbcType=VARCHAR},
|
|
#{cfdsLevel,jdbcType=INTEGER},
|
|
#{fileUrl,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
<!-- 删除ftp ip子配置 -->
|
|
<delete id="deleteFtpIpCfg" >
|
|
delete from ip_port_cfg where compile_id=#{compileId} and protocol_id=7 and function_id=#{functionId}
|
|
</delete>
|
|
<!-- 删除ftp关键字配置 -->
|
|
<delete id="deleteFtpKeywordCfg">
|
|
delete from ftp_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<!-- 删除ftp文件摘要配置 -->
|
|
<delete id="deleteFileDigestCfg">
|
|
delete from file_digest_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
|
|
<!-- 删除p2p ip子配置 -->
|
|
<delete id="deleteP2pIpCfg" >
|
|
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<!-- 删除p2pHash配置 -->
|
|
<delete id="deleteP2pHashCfg">
|
|
delete from p2p_hash_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<!-- 删除p2p关键字配置 -->
|
|
<delete id="deleteP2pKeywordCfg">
|
|
delete from p2p_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<!-- 删除p2pSubscribeId配置 -->
|
|
<delete id="deleteP2pSubscribeIdCfg">
|
|
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<!-- 删除FileDigest SubscribeId配置 -->
|
|
<delete id="deleteFileDigestSubscribeIdCfg">
|
|
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
|
|
<!-- File Digest Cfg -->
|
|
<select id="getFileDigestList" resultMap="digestCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg" >
|
|
SELECT
|
|
<include refid="DigestCfg_Column" />
|
|
<trim prefix="," prefixOverrides=",">
|
|
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
|
,ri.request_title as requestName
|
|
</trim>
|
|
FROM file_digest_cfg a
|
|
left join sys_user s on a.creator_id=s.id
|
|
left join sys_user e on a.editor_id=e.id
|
|
left join sys_user u on a.auditor_id=u.id
|
|
left join request_info ri on a.request_id=ri.id
|
|
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="page !=null and page.where != null and page.where != ''">
|
|
AND ${page.where}
|
|
</if>
|
|
<if test="cfgId != null">
|
|
AND a.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
|
</if>
|
|
<if test="cfgDesc != null and cfgDesc != ''">
|
|
AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="cfdsLevel != null">
|
|
AND a.CFDS_LEVEL=#{cfdsLevel,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="action != null">
|
|
AND a.ACTION=#{action,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid != null">
|
|
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isValid == null">
|
|
AND a.IS_VALID != -1
|
|
</if>
|
|
<if test="isAudit != null">
|
|
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="creatorName != null and creatorName != ''">
|
|
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="editorName != null and editorName != ''">
|
|
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="auditorName != null and auditorName != ''">
|
|
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="serviceId != null">
|
|
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="requestId != null">
|
|
AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="compileId != null">
|
|
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="isAreaEffective != null">
|
|
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="classify != null and classify != ''">
|
|
AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="attribute != null and attribute != ''">
|
|
AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="lable != null and lable != ''">
|
|
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
|
AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
<!-- 数据范围过滤 -->
|
|
${sqlMap.dsf}
|
|
</trim>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc
|
|
</when>
|
|
<otherwise>
|
|
ORDER BY a.is_audit,a.CFG_ID desc
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
<select id="getFileDigest" resultMap="digestCfgMap">
|
|
SELECT
|
|
<include refid="DigestCfg_Column" />
|
|
FROM file_digest_cfg a
|
|
<where>
|
|
<if test="cfgId != null">
|
|
a.CFG_ID=#{cfgId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="compileId != null">
|
|
and a.compile_Id=#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="getFileDigestSubscribeidList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg">
|
|
SELECT
|
|
<include refid="StrCfg_Column" />
|
|
FROM ntc_subscribe_id_cfg a where compile_id=#{compileId} and function_id=#{functionId}
|
|
<!-- <if test="cfgType != null and cfgType != ''">
|
|
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
|
|
</if> -->
|
|
</select>
|
|
|
|
<update id="updateFileDigestCfg" parameterType="com.nis.domain.configuration.FileDigestCfg" >
|
|
update file_digest_cfg
|
|
<set >
|
|
<trim suffixOverrides=",">
|
|
<if test="cfgDesc != null and cfgDesc != ''" >
|
|
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="action != null" >
|
|
action = #{action,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isValid != null" >
|
|
is_valid = #{isValid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAudit != null" >
|
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="creatorId != null" >
|
|
creator_id = #{creatorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="createTime != null and createTime != ''" >
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="editorId != null" >
|
|
editor_id = #{editorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="editTime != null and editTime != ''" >
|
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="auditorId != null" >
|
|
auditor_id = #{auditorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="auditTime != null and auditTime != ''" >
|
|
audit_time = #{auditTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="serviceId != null" >
|
|
service_id = #{serviceId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="requestId != null" >
|
|
request_id = #{requestId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAreaEffective != null" >
|
|
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="classify != null and classify != ''" >
|
|
classify = #{classify,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="attribute != null and attribute != ''" >
|
|
attribute = #{attribute,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="lable != null and lable != ''" >
|
|
lable = #{lable,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="areaEffectiveIds != null" >
|
|
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="functionId != null" >
|
|
function_id = #{functionId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="rawLen != null" >
|
|
RAW_LEN = #{rawLen,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="digest != null and digest != ''" >
|
|
digest = #{digest,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="cfdsLevel != null" >
|
|
CFDS_LEVEL = #{cfdsLevel,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="cfgRegionCode != null">
|
|
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="cfgType != null and cfgType != ''">
|
|
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="fileUrl != null and fileUrl != ''">
|
|
FILE_URL =#{fileUrl,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="doLog != null">
|
|
do_log =#{doLog,jdbcType=INTEGER},
|
|
</if>
|
|
</trim>
|
|
</set>
|
|
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
|
</update>
|
|
|
|
<select id="getFileByDigestList" resultMap="digestCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg" >
|
|
SELECT
|
|
<include refid="DigestCfg_Column" />
|
|
<trim prefix="," prefixOverrides=",">
|
|
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
|
,ri.request_title as requestName
|
|
</trim>
|
|
FROM file_digest_cfg a
|
|
left join sys_user s on a.creator_id=s.id
|
|
left join sys_user e on a.editor_id=e.id
|
|
left join sys_user u on a.auditor_id=u.id
|
|
left join request_info ri on a.request_id=ri.id
|
|
where a.CFG_ID in (${ids})
|
|
</select>
|
|
|
|
</mapper> |