1069 lines
44 KiB
XML
1069 lines
44 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.CommonPolicyDao" >
|
|
<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="dns_strategy_id" property="dnsStrategyId" jdbcType="INTEGER" />
|
|
<result column="dns_strategy_name" property="dnsStrategyName" jdbcType="VARCHAR" />
|
|
<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="source_compile_id" property="sourceCompileId" jdbcType="INTEGER" />
|
|
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
|
<result column="do_blacklist" property="doBlackList" jdbcType="INTEGER" />
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="CacheMap" type="com.nis.domain.configuration.CachePolicyUserRegion" >
|
|
<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="dns_strategy_id" property="dnsStrategyId" jdbcType="INTEGER" />
|
|
<result column="dns_strategy_name" property="dnsStrategyName" jdbcType="VARCHAR" />
|
|
<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="source_compile_id" property="sourceCompileId" jdbcType="INTEGER" /> -->
|
|
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
|
<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="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
|
<result column="dest_ip_pattern" property="destIpPattern" 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" />
|
|
</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" />
|
|
</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>
|
|
<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.dns_strategy_id,a.user_region1,
|
|
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.source_compile_id,a.cancel_request_id,
|
|
a.do_blacklist
|
|
</sql>
|
|
<sql id="IpCfg_Column" >
|
|
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.src_ip_pattern,a.dest_ip_pattern,a.src_port_pattern,a.dest_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
|
|
</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
|
|
</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>
|
|
|
|
<select id="getPolicyList" 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="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
|
|
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
|
|
<if test="index == 0">
|
|
AND a.COMPILE_ID >= #{item,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="index == 1">
|
|
AND a.COMPILE_ID <= #{item,jdbcType=INTEGER}
|
|
</if>
|
|
</foreach>
|
|
</if>
|
|
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
|
|
AND a.COMPILE_ID in
|
|
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
|
|
AND a.COMPILE_ID=#{compileIdNew,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="functionId != null">
|
|
AND t.function_id=#{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
<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="strCfg!=null">
|
|
AND a.compile_id in (select f.compile_id from common_keyword_cfg f
|
|
<where>
|
|
<if test="strCfg.cfgKeywords != null and strCfg.cfgKeywords != ''">
|
|
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{strCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
|
|
</if>
|
|
|
|
</where>
|
|
)
|
|
</if>
|
|
<if test="complexCfg!=null">
|
|
AND a.compile_id in (select f.compile_id from complex_keyword_cfg f
|
|
<where>
|
|
<if test="complexCfg.cfgKeywords != null and complexCfg.cfgKeywords != ''">
|
|
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{complexCfg.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="getPolicyById" resultMap="CfgIndexInfoMap" parameterType="java.lang.Long">
|
|
SELECT
|
|
<include refid="ConfigIndex_Column" />
|
|
FROM cfg_index_info a where cfg_id=#{cfgId}
|
|
</select>
|
|
<!-- <select id="getCfgIndexList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="ConfigIndex_Column" />
|
|
FROM cfg_index_info a
|
|
<where>
|
|
<if test="cfgId != null">
|
|
and cfg_id=#{cfgId}
|
|
</if>
|
|
<if test="compileId != null">
|
|
and compileId=#{compileId}
|
|
</if>
|
|
<if test="functionId != null">
|
|
and function_id=#{functionId}
|
|
</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>
|
|
|
|
<select id="getCommonStringList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="StrCfg_Column" />
|
|
FROM common_keyword_cfg a
|
|
<where>
|
|
<if test="compileId != null">
|
|
AND a.compile_id =#{compileId}
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND a.function_id =#{functionId}
|
|
</if>
|
|
<if test="cfgType != null and cfgType !='' ">
|
|
AND a.cfg_type =#{cfgType}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getComplexStringList" resultMap="complexCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
SELECT
|
|
<include refid="ComplexCfg_Column" />
|
|
FROM complex_keyword_cfg a
|
|
<where>
|
|
<if test="compileId != null">
|
|
AND a.compile_id =#{compileId}
|
|
</if>
|
|
<if test="functionId != null">
|
|
AND a.function_id =#{functionId}
|
|
</if>
|
|
<if test="cfgType != null and cfgType !='' ">
|
|
AND a.cfg_type =#{cfgType}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<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,
|
|
dns_strategy_id,
|
|
user_region1,
|
|
user_region2,
|
|
user_region3,
|
|
user_region4,
|
|
user_region5,
|
|
do_log,
|
|
source_compile_id,
|
|
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},
|
|
#{dnsStrategyId,jdbcType=INTEGER},
|
|
#{userRegion1,jdbcType=VARCHAR},
|
|
#{userRegion2,jdbcType=VARCHAR},
|
|
#{userRegion3,jdbcType=VARCHAR},
|
|
#{userRegion4,jdbcType=VARCHAR},
|
|
#{userRegion5,jdbcType=VARCHAR},
|
|
#{doLog,jdbcType=INTEGER},
|
|
#{sourceCompileId,jdbcType=INTEGER},
|
|
#{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,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_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},
|
|
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
|
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,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>
|
|
<insert id="saveCommonStringCfg" parameterType="com.nis.domain.configuration.CommonStringCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into common_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,
|
|
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},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,jdbcType=INTEGER},
|
|
#{userRegion1,jdbcType=VARCHAR},
|
|
#{userRegion2,jdbcType=VARCHAR},
|
|
#{userRegion3,jdbcType=VARCHAR},
|
|
#{userRegion4,jdbcType=VARCHAR},
|
|
#{userRegion5,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
|
|
<!-- insert http_res_hdr_cfg表信息 -->
|
|
<insert id="saveComplexStringCfg" parameterType="com.nis.domain.configuration.ComplexStringCfg" >
|
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
|
SELECT LAST_INSERT_ID()
|
|
</selectKey>
|
|
insert into complex_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,
|
|
district,
|
|
cfg_keywords,
|
|
cfg_type,
|
|
cfg_region_code,
|
|
expr_type,
|
|
match_method,
|
|
is_hexbin,
|
|
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},
|
|
#{district,jdbcType=VARCHAR},
|
|
#{cfgKeywords,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER},
|
|
#{exprType,jdbcType=INTEGER},
|
|
#{matchMethod,jdbcType=INTEGER},
|
|
#{isHexbin,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="doLog != null" >
|
|
do_log = #{doLog,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="doBlackList != null">
|
|
do_blacklist = #{doBlackList,jdbcType=INTEGER},
|
|
</if>
|
|
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
|
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
|
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
|
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
|
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
|
</trim>
|
|
</set>
|
|
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
|
</update>
|
|
|
|
<!-- 删除子配置 -->
|
|
<delete id="deleteIpPortCfg" >
|
|
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<delete id="deleteCommonStringCfg">
|
|
delete from common_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<delete id="deleteComplexStringCfg">
|
|
delete from complex_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<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}
|
|
<if test="isAudit !=null ">
|
|
,is_audit = #{isAudit,jdbcType=BIGINT}
|
|
</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>
|
|
<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>
|
|
<update id="auditCfgBatch">
|
|
<choose>
|
|
<when test="tableName == 'config_group_info'" >
|
|
update ${tableName} set is_issued = #{entity.isValid,jdbcType=INTEGER},
|
|
update_time = #{entity.auditTime,jdbcType=TIMESTAMP}
|
|
<where>
|
|
and compile_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</where>
|
|
</when>
|
|
<when test="tableName == 'asn_group_info'" >
|
|
update ${tableName} set is_valid = #{entity.isValid,jdbcType=INTEGER}
|
|
<where>
|
|
and compile_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</where>
|
|
</when>
|
|
<when test="tableName == 'pxy_obj_spoofing_ip_pool'" >
|
|
UPDATE ${tableName} SET
|
|
is_valid = #{entity.isValid,jdbcType=INTEGER},
|
|
is_audit = #{entity.isAudit,jdbcType=INTEGER},
|
|
auditor_id = #{entity.auditorId,jdbcType=INTEGER},
|
|
audit_time = #{entity.auditTime,jdbcType=TIMESTAMP}
|
|
<where>
|
|
AND cfg_id IN
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</where>
|
|
</when>
|
|
<otherwise>
|
|
update ${tableName} set is_audit = #{entity.isAudit,jdbcType=INTEGER},
|
|
auditor_id = #{entity.auditorId,jdbcType=INTEGER},
|
|
audit_time = #{entity.auditTime,jdbcType=TIMESTAMP}
|
|
<if test="entity.isValid != null" >
|
|
,is_valid = #{entity.isValid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="requestId != null" >
|
|
,cancel_request_id = #{requestId,jdbcType=INTEGER}
|
|
</if>
|
|
<where>
|
|
<choose>
|
|
<when test="tableName == 'app_ip_cfg'">
|
|
and user_region1 in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</when >
|
|
<when test=" tableName == 'asn_ip_cfg'">
|
|
and region_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</when >
|
|
<when test=" tableName == 'pxy_obj_trusted_ca_crl'">
|
|
and cert_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</when >
|
|
<otherwise>
|
|
and compile_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</otherwise>
|
|
</choose>
|
|
</where>
|
|
</otherwise>
|
|
</choose>
|
|
</update>
|
|
<update id="deleteHttpUrlCfg">
|
|
update ${tableName} set is_valid =-1,is_audit = 0,
|
|
editor_id = #{entity.auditorId,jdbcType=INTEGER},
|
|
edit_time = #{entity.auditTime,jdbcType=TIMESTAMP}
|
|
<where>
|
|
and compile_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</where>
|
|
</update>
|
|
|
|
<select id="getHttpUrlCfgBySourceCompileId" resultMap="CfgIndexInfoMap">
|
|
SELECT
|
|
<include refid="ConfigIndex_Column" />
|
|
FROM cfg_index_info a
|
|
<where>
|
|
and source_compile_id in
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getCachePolicyUserRegionList" resultMap="CacheMap" parameterType="com.nis.domain.configuration.CachePolicyUserRegion" >
|
|
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="compileIdNew != null and compileIdNew != '' and compileIdNew.indexOf('-') != -1">
|
|
<foreach collection="compileIdNew.split('-')" index="index" item="item" >
|
|
<if test="index == 0">
|
|
AND a.COMPILE_ID >= #{item,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="index == 1">
|
|
AND a.COMPILE_ID <= #{item,jdbcType=INTEGER}
|
|
</if>
|
|
</foreach>
|
|
</if>
|
|
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1">
|
|
AND a.COMPILE_ID in
|
|
<foreach collection="compileIdNew.split(',')" index="index" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
<if test="compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1">
|
|
AND a.COMPILE_ID=#{compileIdNew,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="strCfg!=null">
|
|
AND a.compile_id in (select f.compile_id from common_keyword_cfg f
|
|
<where>
|
|
<if test="strCfg.cfgKeywords != null and strCfg.cfgKeywords != ''">
|
|
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{strCfg.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="getCachePolicyByUserRegionList" resultMap="CacheMap" parameterType="com.nis.domain.configuration.CachePolicyUserRegion" >
|
|
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
|
|
where a.CFG_ID in (${ids})
|
|
</select>
|
|
|
|
<update id="deleteCfgBatch">
|
|
UPDATE ${tableName}
|
|
SET is_valid =-1,is_audit=0,
|
|
editor_id = #{entity.editorId,jdbcType=INTEGER},
|
|
edit_time = #{entity.editTime,jdbcType=TIMESTAMP}
|
|
<where>
|
|
<choose>
|
|
<when test="tableName == 'app_ip_cfg'">
|
|
AND user_region1 IN
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</when>
|
|
<when test="tableName == 'asn_ip_cfg'">
|
|
AND region_id IN
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</when>
|
|
<when test="tableName == 'pxy_obj_spoofing_ip_pool'" >
|
|
AND cfg_id IN
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</when>
|
|
<otherwise>
|
|
AND compile_id IN
|
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
|
#{compileId}
|
|
</foreach>
|
|
</otherwise>
|
|
</choose>
|
|
</where>
|
|
</update>
|
|
|
|
<update id="clearPolicies" parameterType="java.lang.String">
|
|
UPDATE ${tableName}
|
|
SET is_valid = -1, is_audit = 0
|
|
WHERE is_valid != -1
|
|
</update>
|
|
|
|
</mapper> |