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" >
<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" />
<result column= "ip_type" property= "ipType" jdbcType= "INTEGER" />
<result column= "src_ip" property= "srcIp" jdbcType= "VARCHAR" />
<result column= "src_ip_mask" property= "srcIpMask" jdbcType= "VARCHAR" />
<result column= "src_port" property= "srcPort" jdbcType= "VARCHAR" />
<result column= "src_port_mask" property= "srcPortMask" jdbcType= "VARCHAR" />
<result column= "dst_ip" property= "dstIp" jdbcType= "VARCHAR" />
<result column= "dst_ip_mask" property= "dstIpMask" jdbcType= "VARCHAR" />
<result column= "dst_port" property= "dstPort" jdbcType= "VARCHAR" />
2018-02-25 18:43:20 +08:00
<result column= "dst_port_mask" property= "dstPortMask" 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" />
</resultMap>
2018-02-25 18:43:20 +08:00
<resultMap id= "BaseIpMapWithUser" type= "com.nis.domain.configuration.BaseIpCfg" >
<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" property= "srcIp" jdbcType= "VARCHAR" />
<result column= "src_ip_mask" property= "srcIpMask" jdbcType= "VARCHAR" />
<result column= "src_port" property= "srcPort" jdbcType= "VARCHAR" />
<result column= "src_port_mask" property= "srcPortMask" jdbcType= "VARCHAR" />
<result column= "dst_ip" property= "dstIp" jdbcType= "VARCHAR" />
<result column= "dst_ip_mask" property= "dstIpMask" jdbcType= "VARCHAR" />
<result column= "dst_port" property= "dstPort" jdbcType= "VARCHAR" />
<result column= "dst_port_mask" property= "dstPortMask" jdbcType= "VARCHAR" />
<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= "creator_name" property= "creatorName" jdbcType= "VARCHAR" />
<result column= "auditor_name" property= "auditorName" jdbcType= "VARCHAR" />
<result column= "editor_name" property= "editorName" jdbcType= "VARCHAR" />
</resultMap>
2018-02-23 09:54:28 +08:00
<resultMap id= "FtpIpMap" type= "com.nis.domain.configuration.FtpIpCfg" extends= "BaseIpMap" />
<resultMap id= "HttpIpMap" type= "com.nis.domain.configuration.HttpIpCfg" extends= "BaseIpMap" />
<resultMap id= "L2tpIpMap" type= "com.nis.domain.configuration.L2tpIpCfg" extends= "BaseIpMap" />
<resultMap id= "MailIpMap" type= "com.nis.domain.configuration.MailIpCfg" extends= "BaseIpMap" />
<resultMap id= "MmsIpMap" type= "com.nis.domain.configuration.MmsIpCfg" extends= "BaseIpMap" />
<resultMap id= "OpenvpnIpMap" type= "com.nis.domain.configuration.OpenvpnIpCfg" extends= "BaseIpMap" />
<resultMap id= "PptpIpMap" type= "com.nis.domain.configuration.PptpIpCfg" extends= "BaseIpMap" />
<resultMap id= "RtmpIpMap" type= "com.nis.domain.configuration.RtmpIpCfg" extends= "BaseIpMap" />
<resultMap id= "RtpIpMap" type= "com.nis.domain.configuration.RtpIpCfg" extends= "BaseIpMap" />
<resultMap id= "RtspIpMap" type= "com.nis.domain.configuration.RtspIpCfg" extends= "BaseIpMap" />
<resultMap id= "SipIpMap" type= "com.nis.domain.configuration.SipIpCfg" extends= "BaseIpMap" />
<resultMap id= "SshIpMap" type= "com.nis.domain.configuration.SshIpCfg" extends= "BaseIpMap" />
<resultMap id= "SslIpMap" type= "com.nis.domain.configuration.SslIpCfg" extends= "BaseIpMap" />
<sql id= "BaseIpCfg_Column_List_with_id" >
CFG_ID, CFG_DESC, IP_TYPE, SRC_IP, SRC_IP_MASK, SRC_PORT,
SRC_PORT_MASK ,DST_IP ,DST_IP_MASK, DST_PORT, DST_PORT_MASK,
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,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS
</sql>
2018-03-09 20:59:13 +08:00
<!-- <sql id="BaseIpCfg_Column_List_with_id_alias" >
2018-02-27 15:31:30 +08:00
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.IP_TYPE as ipType, r.SRC_IP as srcIp, r.SRC_IP_MASK as srcIpMask, r.SRC_PORT as srcPort,
2018-02-25 18:43:20 +08:00
r.SRC_PORT_MASK as srcPortMask ,r.DST_IP as dstIp,r.DST_IP_MASK as dstIpMask, r.DST_PORT as dstPort, r.DST_PORT_MASK as dstPortMask,
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
2018-03-09 20:59:13 +08:00
</sql> -->
<sql id= "BaseIpCfg_Column_List_with_id_alias" >
<choose >
<when test= "page !=null and page.alias != null and page.alias != ''" >
${page.alias}.CFG_ID as cfgId, ${page.alias}.CFG_DESC as cfgDesc, ${page.alias}.IP_TYPE as ipType, ${page.alias}.SRC_IP as srcIp, ${page.alias}.SRC_IP_MASK as srcIpMask, ${page.alias}.SRC_PORT as srcPort,
${page.alias}.SRC_PORT_MASK as srcPortMask ,${page.alias}.DST_IP as dstIp,${page.alias}.DST_IP_MASK as dstIpMask, ${page.alias}.DST_PORT as dstPort, ${page.alias}.DST_PORT_MASK as dstPortMask,
${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,
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds
</when>
<otherwise >
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.IP_TYPE as ipType, r.SRC_IP as srcIp, r.SRC_IP_MASK as srcIpMask, r.SRC_PORT as srcPort,
r.SRC_PORT_MASK as srcPortMask ,r.DST_IP as dstIp,r.DST_IP_MASK as dstIpMask, r.DST_PORT as dstPort, r.DST_PORT_MASK as dstPortMask,
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
</otherwise>
</choose>
2018-02-25 18:43:20 +08:00
</sql>
2018-02-23 09:54:28 +08:00
<sql id= "BaseIpCfg_Column_List" >
CFG_DESC, IP_TYPE, SRC_IP, SRC_IP_MASK, SRC_PORT,
SRC_PORT_MASK ,DST_IP ,DST_IP_MASK, DST_PORT, DST_PORT_MASK,
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,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS
</sql>
<sql id= "BaseIpCfg_Value_List" >
#{cfgDesc,jdbcType=VARCHAR},#{ipType,jdbcType=INTEGER},
#{srcIp,jdbcType=VARCHAR},#{srcIpMask,jdbcType=VARCHAR},#{srcPort,jdbcType=VARCHAR},
#{srcPortMask,jdbcType=VARCHAR},#{dstIp,jdbcType=VARCHAR},#{dstIpMask,jdbcType=VARCHAR},
#{dstPort,jdbcType=VARCHAR},#{dstPortMask,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{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},
#{areaEffectiveIds,jdbcType=VARCHAR}
</sql>
<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-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-03-05 16:30:16 +08:00
,ri.request_title as requestName
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-03-07 17:47:30 +08:00
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
2018-03-12 16:34:55 +08:00
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=2 and sdia.is_leaf=0
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=3 and sdil.is_leaf=0
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-03-12 11:38:46 +08:00
<if test= "ipType != null" >
2018-03-09 20:59:13 +08:00
AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
<if test= "srcIp != null and srcIp != ''" >
2018-03-26 17:34:07 +08:00
AND ${page.alias}.SRC_IP like concat('%', #{srcIp,jdbcType=VARCHAR}, '%')
2018-03-09 20:59:13 +08:00
</if>
<if test= "srcIpMask != null and srcIpMask != ''" >
AND ${page.alias}.SRC_IP_MASK=#{srcIpMask,jdbcType=VARCHAR}
</if>
<if test= "srcPort != null and srcPort !=''" >
AND ${page.alias}.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test= "srcPortMask != null and srcPortMask !=''" >
AND ${page.alias}.SRC_PORT_MASK=#{srcPortMask,jdbcType=VARCHAR}
</if>
<if test= "dstIp != null and dstIp !=''" >
2018-03-26 17:34:07 +08:00
AND ${page.alias}.DST_IP like concat('%', #{dstIp,jdbcType=VARCHAR}, '%')
2018-03-09 20:59:13 +08:00
</if>
<if test= "dstIpMask != null and dstIpMask !=''" >
AND ${page.alias}.DST_IP_MASK=#{dstIpMask,jdbcType=VARCHAR}
</if>
<if test= "dstPort != null and dstPort !=''" >
AND ${page.alias}.DST_PORT=#{dstPort,jdbcType=VARCHAR}
</if>
<if test= "dstPortMask != null and dstPortMask !=''" >
AND ${page.alias}.DST_PORT_MASK=#{dstPortMask,jdbcType=VARCHAR}
</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>
</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-03-12 11:38:46 +08:00
<if test= "ipType != null" >
2018-03-09 20:59:13 +08:00
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
<if test= "srcIp != null and srcIp != ''" >
AND r.SRC_IP=#{srcIp,jdbcType=VARCHAR}
</if>
<if test= "srcIpMask != null and srcIpMask != ''" >
AND r.SRC_IP_MASK=#{srcIpMask,jdbcType=VARCHAR}
</if>
<if test= "srcPort != null and srcPort !=''" >
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test= "srcPortMask != null and srcPortMask !=''" >
AND r.SRC_PORT_MASK=#{srcPortMask,jdbcType=VARCHAR}
</if>
<if test= "dstIp != null and dstIp !=''" >
AND r.DST_IP=#{dstIp,jdbcType=VARCHAR}
</if>
<if test= "dstIpMask != null and dstIpMask !=''" >
AND r.DST_IP_MASK=#{dstIpMask,jdbcType=VARCHAR}
</if>
<if test= "dstPort != null and dstPort !=''" >
AND r.DST_PORT=#{dstPort,jdbcType=VARCHAR}
</if>
<if test= "dstPortMask != null and dstPortMask !=''" >
AND r.DST_PORT_MASK=#{dstPortMask,jdbcType=VARCHAR}
</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>
</otherwise>
</choose>
2018-02-25 18:43:20 +08:00
</trim>
<choose >
<when test= "page !=null and page.orderBy != null and page.orderBy != ''" >
ORDER BY ${page.orderBy}
</when>
<otherwise >
2018-03-09 20:59:13 +08:00
ORDER BY 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>
from ${tableName}
<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 != ''" >
ORDER BY ${page.orderBy}
</when>
<otherwise >
ORDER BY CFG_ID desc
</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" />
)
</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>
<if test= "ipType != null" >
ip_type = #{ipType,jdbcType=INTEGER},
</if>
2018-03-12 11:38:46 +08:00
<if test= "srcIp != null and srcIp != ''" >
2018-02-26 13:53:37 +08:00
src_ip = #{srcIp,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "srcIpMask != null and srcIpMask != ''" >
2018-02-26 13:53:37 +08:00
src_ip_mask = #{srcIpMask,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "srcPort != null and srcPort != ''" >
2018-02-26 13:53:37 +08:00
src_port = #{srcPort,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "srcPortMask != null and srcPortMask != ''" >
2018-02-26 13:53:37 +08:00
src_port_mask = #{srcPortMask,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "dstIp != null and dstIp != ''" >
2018-02-26 13:53:37 +08:00
dst_ip = #{dstIp,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "dstIpMask != null and dstIpMask != ''" >
2018-02-26 13:53:37 +08:00
dst_ip_mask = #{dstIpMask,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "dstPort != null and dstPort != ''" >
2018-02-26 13:53:37 +08:00
dst_port = #{dstPort,jdbcType=VARCHAR},
</if>
2018-03-12 11:38:46 +08:00
<if test= "srcPortMask != null and srcPortMask != ''" >
2018-02-26 13:53:37 +08:00
dst_port_mask = #{srcPortMask,jdbcType=VARCHAR},
</if>
<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-02-26 13:53:37 +08:00
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}
</if>
</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-02-23 09:54:28 +08:00
</mapper>