2018-02-23 09:54:28 +08:00
<?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.IpCfgDao" >
2019-04-18 10:15:23 +08:00
<!-- 基础 -->
2018-02-23 09:54:28 +08:00
<resultMap id= "BaseIpMap" type= "com.nis.domain.configuration.BaseIpCfg" >
<id column= "cfg_id" property= "cfgId" jdbcType= "BIGINT" />
<result column= "cfg_desc" property= "cfgDesc" jdbcType= "VARCHAR" />
2018-05-21 09:05:21 +08:00
<result column= "cfg_type" property= "cfgType" jdbcType= "VARCHAR" />
<result column= "cfg_region_code" property= "cfgRegionCode" jdbcType= "INTEGER" />
2018-02-23 09:54:28 +08:00
<result column= "ip_type" property= "ipType" jdbcType= "INTEGER" />
2019-04-18 10:15:23 +08:00
<result column= "src_ip_pattern" property= "srcIpPattern" jdbcType= "INTEGER" />
<result column= "dest_ip_pattern" property= "destIpPattern" jdbcType= "INTEGER" />
2018-05-22 17:24:26 +08:00
<result column= "src_ip_address" property= "srcIpAddress" jdbcType= "VARCHAR" />
<result column= "dest_ip_address" property= "destIpAddress" jdbcType= "VARCHAR" />
2018-05-21 09:05:21 +08:00
<result column= "port_pattern" property= "portPattern" jdbcType= "INTEGER" />
2018-05-22 17:24:26 +08:00
<result column= "src_port" property= "srcPort" jdbcType= "VARCHAR" />
<result column= "dest_port" property= "destPort" jdbcType= "VARCHAR" />
2018-02-23 09:54:28 +08:00
<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" />
2018-05-17 19:08:37 +08:00
<result column= "function_id" property= "functionId" jdbcType= "INTEGER" />
2018-08-25 16:37:39 +08:00
<result column= "ratelimit" property= "ratelimit" jdbcType= "VARCHAR" />
2018-06-25 16:55:45 +08:00
<result column= "dns_strategy_id" property= "dnsStrategyId" jdbcType= "INTEGER" />
2018-06-28 17:19:06 +08:00
<result column= "ir_type" property= "irType" jdbcType= "INTEGER" />
2018-07-06 14:47:55 +08:00
<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" />
2018-02-23 09:54:28 +08:00
</resultMap>
2018-08-24 20:55:20 +08:00
<resultMap id= "BaseIpMapWithUser" type= "com.nis.domain.configuration.BaseIpCfg" extends= "BaseIpMap" >
2018-02-25 18:43:20 +08:00
<result column= "creator_name" property= "creatorName" jdbcType= "VARCHAR" />
<result column= "auditor_name" property= "auditorName" jdbcType= "VARCHAR" />
<result column= "editor_name" property= "editorName" jdbcType= "VARCHAR" />
2018-06-25 16:55:45 +08:00
<result column= "group_name" property= "groupName" jdbcType= "VARCHAR" />
2018-08-24 20:55:20 +08:00
</resultMap>
<!-- new -->
<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" />
2018-12-22 12:55:24 +06:00
<result column= "do_blacklist" property= "doBlackList" jdbcType= "INTEGER" />
2018-08-24 20:55:20 +08:00
<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= "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" />
2019-04-18 10:15:23 +08:00
<result column= "src_ip_pattern" property= "srcIpPattern" jdbcType= "INTEGER" />
<result column= "dest_ip_pattern" property= "destIpPattern" jdbcType= "INTEGER" />
2018-08-24 20:55:20 +08:00
<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" />
2018-02-25 18:43:20 +08:00
</resultMap>
2018-02-23 09:54:28 +08:00
<sql id= "BaseIpCfg_Column_List_with_id" >
2019-04-18 10:15:23 +08:00
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
2018-02-23 09:54:28 +08:00
DIRECTION,PROTOCOL,PROTOCOL_ID,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,
2018-07-06 14:47:55 +08:00
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
2018-02-23 09:54:28 +08:00
</sql>
2018-07-03 14:55:36 +08:00
<sql id= "BaseIpCfg_Column_List_with_id_name" >
2019-04-18 10:15:23 +08:00
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,
2018-07-03 14:55:36 +08:00
DIRECTION,PROTOCOL,PROTOCOL_ID,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,
2018-07-06 14:47:55 +08:00
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
2018-07-03 14:55:36 +08:00
</sql>
2018-03-09 20:59:13 +08:00
<sql id= "BaseIpCfg_Column_List_with_id_alias" >
<choose >
<when test= "page !=null and page.alias != null and page.alias != ''" >
2018-05-21 09:05:21 +08:00
${page.alias}.CFG_ID as cfgId, ${page.alias}.CFG_DESC as cfgDesc,${page.alias}.CFG_REGION_CODE as cfgRegionCode,${page.alias}.CFG_TYPE as cfgType, ${page.alias}.IP_TYPE as ipType,
2019-04-18 10:15:23 +08:00
${page.alias}.SRC_IP_PATTERN as srcIpPattern,${page.alias}.DEST_IP_PATTERN as destIpPattern, ${page.alias}.SRC_IP_ADDRESS as srcIpAddress, ${page.alias}.DEST_IP_ADDRESS as destIpAddress,
${page.alias}.SRC_PORT_PATTERN as srcPortPattern,${page.alias}.DEST_PORT_PATTERN as destPortPattern,${page.alias}.SRC_PORT as srcPort,${page.alias}.DEST_PORT as destPort,
2018-05-21 09:05:21 +08:00
${page.alias}.DIRECTION as direction,${page.alias}.PROTOCOL as protocol,${page.alias}.PROTOCOL_ID as protocolId,${page.alias}.ACTION as action,${page.alias}.IS_VALID as isValid,${page.alias}.IS_AUDIT as isAudit,
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
2018-06-25 16:55:45 +08:00
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId,${page.alias}.RATELIMIT AS ratelimit,
2018-07-06 14:47:55 +08:00
${page.alias}.DNS_STRATEGY_ID AS dnsStrategyId,${page.alias}.IR_TYPE AS irType,
${page.alias}.USER_REGION1 AS userRegion1,
${page.alias}.USER_REGION2 AS userRegion2,
${page.alias}.USER_REGION3 AS userRegion3,
${page.alias}.USER_REGION4 AS userRegion4,
${page.alias}.USER_REGION5 AS userRegion5
2018-03-09 20:59:13 +08:00
</when>
<otherwise >
2018-05-21 09:05:21 +08:00
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
2019-04-18 10:15:23 +08:00
r.src_ip_pattern as srcIpPattern,r.dest_ip_pattern as destIpPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress,
r.src_port_pattern as srcPortPattern,r.dest_port_pattern as destPortPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
2018-05-21 09:05:21 +08:00
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
2018-06-25 16:55:45 +08:00
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId,r.RATELIMIT AS ratelimit,
2018-07-06 14:47:55 +08:00
r.DNS_STRATEGY_ID AS dnsStrategyId,r.IR_TYPE AS irType,
r.USER_REGION1 AS userRegion1,
r.USER_REGION2 AS userRegion2,
r.USER_REGION3 AS userRegion3,
r.USER_REGION4 AS userRegion4,
r.USER_REGION5 AS userRegion5
2018-03-09 20:59:13 +08:00
</otherwise>
</choose>
2018-02-25 18:43:20 +08:00
</sql>
2018-02-23 09:54:28 +08:00
<sql id= "BaseIpCfg_Column_List" >
2018-05-21 09:05:21 +08:00
CFG_DESC,CFG_REGION_CODE,CFG_TYPE,
2019-04-18 10:15:23 +08:00
IP_TYPE,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_IP_ADDRESS,DEST_IP_ADDRESS,SRC_PORT_PATTERN,DEST_PORT_PATTERN,SRC_PORT,DEST_PORT,DIRECTION,
2018-05-21 09:05:21 +08:00
PROTOCOL,PROTOCOL_ID,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,
2018-06-28 17:19:06 +08:00
AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,
2018-07-06 14:47:55 +08:00
DNS_STRATEGY_ID,IR_TYPE,USER_REGION1,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
2018-02-23 09:54:28 +08:00
</sql>
<sql id= "BaseIpCfg_Value_List" >
2018-05-21 09:05:21 +08:00
#{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR},
2019-04-18 10:15:23 +08:00
#{ipType,jdbcType=INTEGER}, #{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
2018-02-23 09:54:28 +08:00
#{protocol,jdbcType=INTEGER},#{protocolId,jdbcType=INTEGER},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{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},
2018-08-25 16:37:39 +08:00
#{areaEffectiveIds,jdbcType=VARCHAR}, #{functionId,jdbcType=INTEGER}, #{ratelimit,jdbcType=VARCHAR},
2018-07-06 14:47:55 +08:00
#{dnsStrategyId,jdbcType=INTEGER},#{irType,jdbcType=INTEGER},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
2018-02-23 09:54:28 +08:00
</sql>
2018-08-24 20:55:20 +08:00
<!-- new -->
<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,
2019-01-18 16:21:20 +08:00
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.do_blacklist
2018-08-24 20:55:20 +08:00
</sql>
<sql id= "IpCfg_Column" >
2019-04-18 10:15:23 +08:00
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
2018-08-24 20:55:20 +08:00
,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
2018-10-15 15:26:43 +08:00
,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
2018-08-24 20:55:20 +08:00
</sql>
2018-02-23 09:54:28 +08:00
<select id= "getById" resultMap= "BaseIpMap" parameterType= "java.lang.Long" >
SELECT
<include refid= "BaseIpCfg_Column_List_with_id" />
FROM ${tableName}
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id= "get" resultMap= "BaseIpMap" >
SELECT
<include refid= "BaseIpCfg_Column_List_with_id" />
FROM ${tableName}
<trim prefix= "WHERE" prefixOverrides= "AND |OR " >
<if test= "cfgId != null" >
2018-02-25 18:43:20 +08:00
AND CFG_ID=#{cfgId,jdbcType=BIGINT}
2018-02-23 09:54:28 +08:00
</if>
<if test= "compileId != null" >
2018-02-25 18:43:20 +08:00
AND COMPILE_ID=#{compileId,jdbcType=INTEGER}
2018-02-23 09:54:28 +08:00
</if>
2018-03-29 14:56:27 +08:00
AND IS_VALID!=-1
2018-02-23 09:54:28 +08:00
</trim>
</select>
2018-05-24 19:33:59 +08:00
<select id= "getListByComileId" resultMap= "BaseIpMap" >
SELECT
<include refid= "BaseIpCfg_Column_List_with_id" />
2018-06-22 16:30:59 +08:00
FROM ${tableName} WHERE IS_VALID!=-1 AND FUNCTION_ID=#{functionId,jdbcType=INTEGER} AND COMPILE_ID in (${ids})
2018-05-24 19:33:59 +08:00
</select>
<select id= "getListByCfgId" resultMap= "BaseIpMap" >
SELECT
<include refid= "BaseIpCfg_Column_List_with_id" />
2018-06-22 16:30:59 +08:00
FROM ${tableName} WHERE IS_VALID!=-1 AND FUNCTION_ID=#{functionId,jdbcType=INTEGER} AND CFG_ID in (${ids})
2018-05-24 19:33:59 +08:00
</select>
2018-04-11 13:45:04 +08:00
<select id= "getList" resultMap= "BaseIpMap" >
SELECT
<include refid= "BaseIpCfg_Column_List_with_id" />
FROM ${tableName} WHERE IS_VALID!=-1 AND COMPILE_ID in (${ids})
</select>
2018-02-25 18:43:20 +08:00
<select id= "findList" resultMap= "BaseIpMapWithUser" >
select
<!-- <choose>
<when test= "page !=null and page.fields != null and page.fields != ''" >
${page.fields}
</when>
<otherwise > -->
<include refid= "BaseIpCfg_Column_List_with_id_alias" />
<!-- </otherwise>
</choose> -->
<trim prefix= "," prefixOverrides= "," >
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
2018-06-25 16:55:45 +08:00
,ri.request_title as requestName,po.group_name as group_name
2018-02-25 18:43:20 +08:00
</trim>
2018-03-09 20:59:13 +08:00
from ${tableName}
<choose >
<when test= "page !=null and page.alias != null and page.alias != ''" >
${page.alias}
</when>
<otherwise > r</otherwise>
</choose>
2018-02-25 18:43:20 +08:00
left join sys_user s on r.creator_id=s.id
2018-02-27 15:31:30 +08:00
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
2018-02-25 18:43:20 +08:00
left join request_info ri on r.request_id=ri.id
2018-06-25 16:55:45 +08:00
left join policy_group_info po on r.dns_strategy_id=po.group_id
2018-02-25 18:43:20 +08:00
<trim prefix= "WHERE" prefixOverrides= "AND |OR " >
<if test= "page !=null and page.where != null and page.where != ''" >
AND ${page.where}
</if>
2018-03-09 20:59:13 +08:00
<choose >
<when test= "page !=null and page.alias != null and page.alias != ''" >
2018-03-12 11:38:46 +08:00
<if test= "cfgId != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test= "cfgDesc != null and cfgDesc != ''" >
AND ${page.alias}.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
2018-05-21 09:05:21 +08:00
<if test= "cfgRegionCode != null" >
AND ${page.alias}.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2018-05-21 09:05:21 +08:00
<if test= "cfgType != null and cfgType != ''" >
AND ${page.alias}.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
2018-03-09 20:59:13 +08:00
</if>
2018-05-21 09:05:21 +08:00
<if test= "ipType != null" >
AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2019-04-18 10:15:23 +08:00
<if test= "srcIpPattern != null" >
AND ${page.alias}.SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test= "destIpPattern != null" >
AND ${page.alias}.DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2018-05-22 17:24:26 +08:00
<if test= "srcIpAddress != null and srcIpAddress != ''" >
AND ${page.alias}.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
</if>
<if test= "destIpAddress != null and destIpAddress != ''" >
AND ${page.alias}.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
2018-03-09 20:59:13 +08:00
</if>
2019-04-18 10:15:23 +08:00
<if test= "srcPortPattern != null" >
AND ${page.alias}.SRC_PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test= "destPortPattern != null" >
AND ${page.alias}.DEST_PORT_PATTERN=#{destPortPattern,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2018-05-22 17:24:26 +08:00
<if test= "srcPort != null and srcPort !=''" >
AND ${page.alias}.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test= "destPort != null and destPort !=''" >
AND ${page.alias}.DEST_PORT=#{destPort,jdbcType=VARCHAR}
2018-03-09 20:59:13 +08:00
</if>
2018-03-12 11:38:46 +08:00
<if test= "direction != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.DIRECTION=#{direction,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "protocol != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.PROTOCOL=#{protocol,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "protocolId != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "action != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.ACTION=#{action,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "isValid != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "isValid == null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.IS_VALID != -1
</if>
2018-03-12 11:38:46 +08:00
<if test= "isAudit != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test= "creatorName != null and creatorName !=''" >
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test= "createTime != null and createTime !=''" >
AND ${page.alias}.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test= "editorName != null and editorName !=''" >
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test= "editTime != null and editTime !='' " >
AND ${page.alias}.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test= "auditorName != null and auditorName !=''" >
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test= "auditTime != null and auditTime !=''" >
AND ${page.alias}.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
2018-03-12 11:38:46 +08:00
<if test= "serviceId != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "requestId != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "compileId != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "isAreaEffective != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test= "classify != null and classify !=''" >
AND ${page.alias}.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test= "attribute != null and attribute !=''" >
AND ${page.alias}.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test= "lable != null and lable !=''" >
AND ${page.alias}.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test= "areaEffectiveIds != null and areaEffectiveIds !=''" >
AND ${page.alias}.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
2018-05-21 09:05:21 +08:00
<if test= "functionId != null" >
AND ${page.alias}.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
2018-06-21 14:51:43 +08:00
<if test= "ratelimit != null" >
2018-08-25 16:37:39 +08:00
AND ${page.alias}.RATELIMIT=#{ratelimit,jdbcType=VARCHAR}
2018-06-21 14:51:43 +08:00
</if>
2018-06-25 16:55:45 +08:00
<if test= "dnsStrategyId != null" >
AND ${page.alias}.DNS_STRATEGY_ID=#{dnsStrategyId,jdbcType=INTEGER}
</if>
2018-06-28 17:19:06 +08:00
<if test= "irType != null" >
AND ${page.alias}.IR_TYPE=#{irType,jdbcType=INTEGER}
</if>
2018-07-06 14:47:55 +08:00
<if test= "userRegion1 != null" >
AND ${page.alias}.USER_REGION1=#{userRegion1,jdbcType=VARCHAR}
</if>
<if test= "userRegion2 != null" >
AND ${page.alias}.USER_REGION2=#{userRegion2,jdbcType=VARCHAR}
</if>
<if test= "userRegion3 != null" >
AND ${page.alias}.USER_REGION3=#{userRegion3,jdbcType=VARCHAR}
</if>
<if test= "userRegion4 != null" >
AND ${page.alias}.USER_REGION4=#{userRegion4,jdbcType=VARCHAR}
</if>
<if test= "userRegion5 != null" >
AND ${page.alias}.USER_REGION5=#{userRegion5,jdbcType=VARCHAR}
</if>
2018-03-09 20:59:13 +08:00
</when>
<otherwise >
2018-03-12 11:38:46 +08:00
<if test= "cfgId != null" >
2018-03-09 20:59:13 +08:00
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test= "cfgDesc != null and cfgDesc != ''" >
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
2018-05-21 09:05:21 +08:00
<if test= "cfgRegionCode != null" >
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2018-05-21 09:05:21 +08:00
<if test= "cfgType != null and cfgType != ''" >
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
2018-03-09 20:59:13 +08:00
</if>
2018-05-21 09:05:21 +08:00
<if test= "ipType != null" >
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2019-04-18 10:15:23 +08:00
<if test= "srcIpPattern != null" >
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
</if>
<if test= "destIpPattern != null" >
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2018-05-22 17:24:26 +08:00
<if test= "srcIpAddress != null and srcIpAddress != ''" >
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
</if>
<if test= "destIpAddress != null and destIpAddress != ''" >
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
2018-03-09 20:59:13 +08:00
</if>
2019-04-18 10:15:23 +08:00
<if test= "srcPortPattern != null" >
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
</if>
<if test= "destPortPattern != null" >
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
2018-03-09 20:59:13 +08:00
</if>
2018-05-22 17:24:26 +08:00
<if test= "srcPort != null and srcPort !=''" >
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test= "destPort != null and destPort !=''" >
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
2018-03-09 20:59:13 +08:00
</if>
2018-03-12 11:38:46 +08:00
<if test= "direction != null" >
2018-03-09 20:59:13 +08:00
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "protocol != null" >
2018-03-09 20:59:13 +08:00
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "protocolId != null" >
2018-03-09 20:59:13 +08:00
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "action != null" >
2018-03-09 20:59:13 +08:00
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "isValid != null" >
2018-03-09 20:59:13 +08:00
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "isValid == null" >
2018-03-09 20:59:13 +08:00
AND r.IS_VALID != -1
</if>
2018-03-12 11:38:46 +08:00
<if test= "isAudit != null" >
2018-03-09 20:59:13 +08:00
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test= "creatorName != null and creatorName !=''" >
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test= "createTime != null and createTime !=''" >
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test= "editorName != null and editorName !=''" >
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test= "editTime != null and editTime !='' " >
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test= "auditorName != null and auditorName !=''" >
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test= "auditTime != null and auditTime !=''" >
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
2018-03-12 11:38:46 +08:00
<if test= "serviceId != null" >
2018-03-09 20:59:13 +08:00
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "requestId != null" >
2018-03-09 20:59:13 +08:00
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "compileId != null" >
2018-03-09 20:59:13 +08:00
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
2018-03-12 11:38:46 +08:00
<if test= "isAreaEffective != null" >
2018-03-09 20:59:13 +08:00
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test= "classify != null and classify !=''" >
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test= "attribute != null and attribute !=''" >
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test= "lable != null and lable !=''" >
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test= "areaEffectiveIds != null and areaEffectiveIds !=''" >
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
2018-05-21 09:05:21 +08:00
<if test= "functionId != null" >
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
2018-06-21 14:51:43 +08:00
<if test= "ratelimit != null" >
2018-08-25 16:37:39 +08:00
AND r.RATELIMIT=#{ratelimit,jdbcType=VARCHAR}
2018-06-21 14:51:43 +08:00
</if>
2018-06-25 16:55:45 +08:00
<if test= "dnsStrategyId != null" >
AND r.DNS_STRATEGY_ID=#{dnsStrategyId,jdbcType=INTEGER}
</if>
2018-06-28 17:19:06 +08:00
<if test= "irType != null" >
AND r.IR_TYPE=#{irType,jdbcType=INTEGER}
</if>
2018-07-06 14:47:55 +08:00
<if test= "userRegion1 != null" >
AND r.USER_REGION1=#{userRegion1,jdbcType=VARCHAR}
</if>
<if test= "userRegion2 != null" >
AND r.USER_REGION2=#{userRegion2,jdbcType=VARCHAR}
</if>
<if test= "userRegion3 != null" >
AND r.USER_REGION3=#{userRegion3,jdbcType=VARCHAR}
</if>
<if test= "userRegion4 != null" >
AND r.USER_REGION4=#{userRegion4,jdbcType=VARCHAR}
</if>
<if test= "userRegion5 != null" >
AND r.USER_REGION5=#{userRegion5,jdbcType=VARCHAR}
</if>
2018-03-09 20:59:13 +08:00
</otherwise>
</choose>
2018-05-21 19:42:24 +08:00
<!-- 数据范围过滤 -->
${sqlMap.dsf}
2018-02-25 18:43:20 +08:00
</trim>
<choose >
<when test= "page !=null and page.orderBy != null and page.orderBy != ''" >
2018-12-23 17:26:30 +06:00
ORDER BY ${page.orderBy},r.is_audit,r.CFG_ID desc
2018-02-25 18:43:20 +08:00
</when>
<otherwise >
2018-12-23 17:26:30 +06:00
ORDER BY r.is_audit,r.CFG_ID desc
2018-02-25 18:43:20 +08:00
</otherwise>
</choose>
</select>
<select id= "findAllList" resultMap= "BaseIpMap" >
2018-02-23 09:54:28 +08:00
select
<choose >
<when test= "page !=null and page.fields != null and page.fields != ''" >
${page.fields}
</when>
<otherwise >
<include refid= "BaseIpCfg_Column_List_with_id" />
</otherwise>
</choose>
2018-12-23 15:44:45 +06:00
from ${tableName} r
2018-02-23 09:54:28 +08:00
<trim prefix= "WHERE" prefixOverrides= "AND |OR " >
<if test= "page !=null and page.where != null and page.where != ''" >
AND ${page.where}
</if>
</trim>
<choose >
<when test= "page !=null and page.orderBy != null and page.orderBy != ''" >
2018-12-23 17:26:30 +06:00
ORDER BY ${page.orderBy},r.is_audit,r.CFG_ID desc
2018-02-23 09:54:28 +08:00
</when>
<otherwise >
2018-12-23 17:26:30 +06:00
ORDER BY r.is_audit,r.CFG_ID desc
2018-02-23 09:54:28 +08:00
</otherwise>
</choose>
</select>
<insert id= "insert" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
<selectKey resultType= "java.lang.Long" order= "AFTER" keyProperty= "cfgId" >
SELECT LAST_INSERT_ID()
</selectKey>
insert into ${tableName} (
<include refid= "BaseIpCfg_Column_List" />
)values (
<include refid= "BaseIpCfg_Value_List" />
2018-11-14 11:32:02 +08:00
)
</insert>
<insert id= "insertForBatch" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
insert into ${tableName} (
<include refid= "BaseIpCfg_Column_List" />
)values (
<include refid= "BaseIpCfg_Value_List" />
2018-02-23 09:54:28 +08:00
)
</insert>
2018-04-13 13:50:29 +08:00
<update id= "update" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
2018-02-23 09:54:28 +08:00
update ${tableName}
<set >
2018-02-26 13:53:37 +08:00
<trim suffixOverrides= "," >
2018-03-12 11:38:46 +08:00
<if test= "cfgDesc != null and cfgDesc != ''" >
2018-02-26 13:53:37 +08:00
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
2018-05-21 09:05:21 +08:00
<if test= "cfgRegionCode != null" >
2018-05-21 19:42:24 +08:00
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
2018-05-21 09:05:21 +08:00
</if>
<if test= "cfgType != null and cfgType != ''" >
2018-05-21 19:42:24 +08:00
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
2018-05-21 09:05:21 +08:00
</if>
2018-02-26 13:53:37 +08:00
<if test= "ipType != null" >
2018-05-21 19:42:24 +08:00
IP_TYPE = #{ipType,jdbcType=INTEGER},
2018-02-26 13:53:37 +08:00
</if>
2019-04-18 10:15:23 +08:00
<if test= "srcIpPattern != null" >
SRC_IP_PATTERN=#{srcIpPattern,jdbcType=INTEGER},
</if>
<if test= "destIpPattern != null" >
DEST_IP_PATTERN=#{destIpPattern,jdbcType=INTEGER},
2018-05-21 09:05:21 +08:00
</if>
2018-05-22 17:24:26 +08:00
<if test= "srcIpAddress != null and srcIpAddress != ''" >
SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
</if>
<if test= "destIpAddress != null and destIpAddress != ''" >
DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
2018-05-21 09:05:21 +08:00
</if>
<if test= "portPattern != null" >
2019-04-18 10:15:23 +08:00
PORT_PATTERN=#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
2018-05-21 09:05:21 +08:00
</if>
2018-05-22 17:24:26 +08:00
<if test= "srcPort != null and srcPort !=''" >
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
</if>
<if test= "destPort != null and destPort !=''" >
DEST_PORT=#{destPort,jdbcType=VARCHAR},
2018-05-21 09:05:21 +08:00
</if>
2018-02-26 13:53:37 +08:00
<if test= "direction != null" >
direction = #{direction,jdbcType=INTEGER},
</if>
<if test= "protocol != null" >
protocol = #{protocol,jdbcType=INTEGER},
</if>
<if test= "protocolId != null" >
protocol_id = #{protocolId,jdbcType=INTEGER},
</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>
2018-03-12 11:38:46 +08:00
<if test= "createTime != null and createTime != ''" >
2018-02-26 13:53:37 +08:00
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test= "editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
2018-03-26 14:43:58 +08:00
<if test= "editTime != null" >
2018-02-26 13:53:37 +08:00
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test= "auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
2018-03-12 11:38:46 +08:00
<if test= "auditTime != null and auditTime != ''" >
2018-02-26 13:53:37 +08:00
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= "compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test= "isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
2018-03-12 11:38:46 +08:00
<if test= "classify != null and classify != ''" >
2018-02-26 13:53:37 +08:00
classify = #{classify,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "attribute != null and attribute != ''" >
2018-02-26 13:53:37 +08:00
attribute = #{attribute,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "lable != null and lable != ''" >
2018-02-26 13:53:37 +08:00
lable = #{lable,jdbcType=VARCHAR},
</if>
2018-04-08 16:15:06 +08:00
<if test= "areaEffectiveIds != null" >
2018-06-02 17:40:14 +08:00
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
2018-02-26 13:53:37 +08:00
</if>
2018-05-21 09:05:21 +08:00
<if test= "functionId != null" >
2018-06-25 16:55:45 +08:00
FUNCTION_ID=#{functionId,jdbcType=INTEGER},
2018-05-21 09:05:21 +08:00
</if>
2018-06-21 14:51:43 +08:00
<if test= "ratelimit != null" >
2018-08-25 16:37:39 +08:00
RATELIMIT=#{ratelimit,jdbcType=VARCHAR},
2018-06-21 14:51:43 +08:00
</if>
2018-06-25 16:55:45 +08:00
<if test= "dnsStrategyId != null" >
DNS_STRATEGY_ID=#{dnsStrategyId,jdbcType=INTEGER},
</if>
2018-06-28 17:19:06 +08:00
<if test= "irType != null" >
IR_TYPE=#{irType,jdbcType=INTEGER},
</if>
2018-07-06 14:47:55 +08:00
<if test= "userRegion1 != null" >
USER_REGION1=#{userRegion1,jdbcType=VARCHAR},
</if>
<if test= "userRegion2 != null" >
USER_REGION2=#{userRegion2,jdbcType=VARCHAR},
</if>
<if test= "userRegion3 != null" >
USER_REGION3=#{userRegion3,jdbcType=VARCHAR},
</if>
<if test= "userRegion4 != null" >
USER_REGION4=#{userRegion4,jdbcType=VARCHAR},
</if>
<if test= "userRegion5 != null" >
USER_REGION5=#{userRegion5,jdbcType=VARCHAR},
</if>
2018-02-26 13:53:37 +08:00
</trim>
2018-02-23 09:54:28 +08:00
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
2018-02-25 18:43:20 +08:00
<update id= "updateValid" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
2018-04-11 13:45:04 +08:00
<update id= "audit" >
2018-02-25 18:43:20 +08:00
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>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<select id= "getIsValid" resultType= "java.lang.Integer" parameterType= "java.lang.Long" >
SELECT IS_VALID FROM ${tableName}
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id= "getIsAudit" resultType= "java.lang.Integer" parameterType= "java.lang.Long" >
SELECT IS_AUDIT FROM ${tableName}
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
2018-04-08 16:15:06 +08:00
<update id= "delete" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
2018-04-11 13:45:04 +08:00
update ${tableName} set is_valid = -1, 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>
</trim>
2018-04-08 16:15:06 +08:00
</update>
2018-03-26 14:43:58 +08:00
<update id= "deleteByCompileId" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
2018-04-09 12:49:19 +08:00
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
2018-03-26 14:43:58 +08:00
</update>
2018-06-14 16:55:54 +08:00
<update id= "deleteByCompileIds" parameterType= "com.nis.domain.configuration.BaseIpCfg" >
update ${tableName} set is_valid = -1, editor_id = #{user,jdbcType=INTEGER} , edit_time = NOW() where compile_id in (${compileIds})
</update>
2018-07-03 14:55:36 +08:00
<select id= "getListByCfgIdWithName" resultMap= "BaseIpMapWithUser" >
select
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
2019-04-18 10:15:23 +08:00
r.src_ip_pattern as srcIpPattern,r.dest_ip_pattern as destIpPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress,
r.src_port_pattern as srcPortPattern,r.dest_port_pattern as destPortPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
2018-07-03 14:55:36 +08:00
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId,r.RATELIMIT AS ratelimit,
2018-07-06 14:47:55 +08:00
r.DNS_STRATEGY_ID AS dnsStrategyId,r.IR_TYPE AS irType,r.USER_REGION1 AS userRegion1,r.USER_REGION2 AS userRegion2,r.USER_REGION3 AS userRegion3,r.USER_REGION4 AS userRegion4,r.USER_REGION5 AS userRegion5
2018-07-03 14:55:36 +08:00
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,po.group_name as group_name
from ${tableName} r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
left join policy_group_info po on r.dns_strategy_id=po.group_id
WHERE r.CFG_ID in (${ids}) AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</select>
2018-08-24 20:55:20 +08:00
<!-- new -->
2018-11-28 19:23:38 +08:00
<select id= "getCfgIndexInfo" resultMap= "CfgIndexInfoMap" >
2018-08-24 20:55:20 +08:00
SELECT
<include refid= "ConfigIndex_Column" />
2018-11-28 19:23:38 +08:00
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>
2018-08-24 20:55:20 +08:00
</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>
<!-- 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,
2018-11-16 11:11:15 +08:00
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,
2018-12-22 12:55:24 +06:00
do_log,
do_blacklist
2018-11-16 11:11:15 +08:00
)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},
2018-12-22 12:55:24 +06:00
#{doLog,jdbcType=INTEGER},
2019-01-18 16:21:20 +08:00
#{doBlackList,jdbcType=INTEGER}
2018-11-16 11:11:15 +08:00
)
</insert>
<insert id= "saveCfgIndexForBatch" parameterType= "com.nis.domain.configuration.CfgIndexInfo" >
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,
2018-08-24 20:55:20 +08:00
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,
2018-12-22 12:55:24 +06:00
do_log,
2019-01-18 16:21:20 +08:00
do_blacklist
2018-08-24 20:55:20 +08:00
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
2018-11-20 22:52:32 +08:00
#{isValid,jdbcType=INTEGER},
#{isAudit,jdbcType=INTEGER},
2018-08-24 20:55:20 +08:00
#{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},
2018-12-22 12:55:24 +06:00
#{doLog,jdbcType=INTEGER},
2019-01-18 16:21:20 +08:00
#{doBlackList,jdbcType=INTEGER}
2018-08-24 20:55:20 +08:00
)
</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,
2019-04-18 10:15:23 +08:00
src_ip_address,SRC_IP_PATTERN,DEST_IP_PATTERN,SRC_PORT_PATTERN,DEST_PORT_PATTERN,
2018-08-24 20:55:20 +08:00
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},
2019-04-18 10:15:23 +08:00
#{srcIpPattern,jdbcType=INTEGER},
#{destIpPattern,jdbcType=INTEGER},
#{srcPortPattern,jdbcType=INTEGER},
#{destPortPattern,jdbcType=INTEGER},
2018-08-24 20:55:20 +08:00
#{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= "," >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
action = #{action,jdbcType=INTEGER},
do_log = #{doLog,jdbcType=INTEGER},
2018-12-22 12:55:24 +06:00
do_blacklist = #{doBlackList,jdbcType=INTEGER},
2018-08-24 20:55:20 +08:00
is_valid = #{isValid,jdbcType=INTEGER},
is_audit = #{isAudit,jdbcType=INTEGER},
<if test= "creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test= "createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
2018-10-18 10:18:03 +08:00
editor_id = #{editorId,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
service_id = #{serviceId,jdbcType=INTEGER},
request_id = #{requestId,jdbcType=INTEGER},
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
classify = #{classify,jdbcType=VARCHAR},
attribute = #{attribute,jdbcType=VARCHAR},
lable = #{lable,jdbcType=VARCHAR},
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
function_id = #{functionId,jdbcType=INTEGER},
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},
dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER},
2018-08-24 20:55:20 +08:00
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<delete id= "deleteIpCfg" >
delete from ip_port_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}
<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>
2018-08-25 11:42:24 +08:00
<select id= "getIpCfgList" resultMap= "CfgIndexInfoMap" parameterType= "com.nis.domain.configuration.CfgIndexInfo" >
2018-08-25 01:55:10 +08:00
SELECT
<include refid= "ConfigIndex_Column" />
<trim prefix= "," prefixOverrides= "," >
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
2019-03-18 16:31:47 +08:00
,ri.request_title as requestName
2018-08-25 01:55:10 +08:00
</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>
2019-05-09 17:31:40 +08:00
<choose >
<!-- 判断是否批量操作 -->
<when test= "batchValidValue != null and batchValidValue != ''" >
AND a.IS_VALID in (${batchValidValue})
</when>
<otherwise >
<if test= "isValid != null" >
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test= "isValid == null" >
AND a.IS_VALID != -1
</if>
</otherwise>
</choose>
<choose >
<!-- 判断是否批量操作 -->
<when test= "batchAuditValue != null and batchAuditValue != ''" >
2019-05-10 18:31:27 +08:00
AND a.IS_AUDIT in(${batchAuditValue})
2019-05-09 17:31:40 +08:00
</when>
<otherwise >
<if test= "isAudit != null" >
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
</otherwise>
</choose>
2018-08-25 01:55:10 +08:00
<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>
2019-04-11 17:13:44 +08:00
<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>
2019-04-11 11:26:39 +08:00
</if>
2019-04-11 17:13:44 +08:00
<if test= "compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') != -1" >
2019-04-11 11:26:39 +08:00
AND a.COMPILE_ID in
2019-04-11 17:13:44 +08:00
<foreach collection= "compileIdNew.split(',')" index= "index" item= "id" open= "(" separator= "," close= ")" >
2019-04-11 11:26:39 +08:00
#{id}
</foreach>
</if>
2019-04-11 17:13:44 +08:00
<if test= "compileIdNew !=null and compileIdNew != '' and compileIdNew.indexOf(',') == -1 and compileIdNew.indexOf('-') == -1" >
AND a.COMPILE_ID=#{compileIdNew,jdbcType=INTEGER}
</if>
2018-08-25 01:55:10 +08:00
<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>
2018-11-04 13:32:02 +08:00
<if test= "ipPort != null" >
AND a.compile_id in (select i.compile_id from ip_port_cfg i
<where >
<if test= "ipPort.srcIpAddress != null and ipPort.srcIpAddress != ''" >
i.src_ip_address = #{ipPort.srcIpAddress,jdbcType=VARCHAR}
</if>
<if test= "ipPort.destIpAddress != null and ipPort.destIpAddress != ''" >
i.dest_ip_address = #{ipPort.destIpAddress,jdbcType=VARCHAR}
</if>
</where>
)
</if>
2018-08-25 01:55:10 +08:00
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose >
<when test= "page !=null and page.orderBy != null and page.orderBy != ''" >
2018-12-23 17:26:30 +06:00
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc
2018-08-25 01:55:10 +08:00
</when>
<otherwise >
2018-12-23 17:26:30 +06:00
ORDER BY a.is_audit,a.CFG_ID desc
2018-08-25 01:55:10 +08:00
</otherwise>
</choose>
</select>
2018-11-29 15:49:47 +08:00
2018-12-17 03:30:34 +08:00
<select id= "getByIdsList" 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,dns.cfg_desc as dns_strategy_name
</trim>
FROM cfg_index_info a
left join dns_res_strategy dns on a.dns_strategy_id=dns.cfg_id
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>
2018-02-23 09:54:28 +08:00
</mapper>