262 lines
10 KiB
XML
262 lines
10 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.AreaIpCfgDao" >
|
|
<resultMap id="BaseIpMap" type="com.nis.domain.configuration.AreaIpCfg" >
|
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
|
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
|
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
|
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
|
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
|
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
|
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
|
<result column="dest_port" property="destPort" 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="function_id" property="functionId" jdbcType="INTEGER" />
|
|
</resultMap>
|
|
<sql id="AreaIpCfg_Column_List_with_id" >
|
|
CFG_ID,CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,
|
|
DEST_PORT,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,FUNCTION_ID
|
|
</sql>
|
|
<select id="getByCompileId" resultMap="BaseIpMap" >
|
|
SELECT
|
|
<include refid="AreaIpCfg_Column_List_with_id" />
|
|
FROM area_ip_cfg
|
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
|
<if test="compileId != null">
|
|
AND COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
AND IS_VALID!=-1
|
|
</trim>
|
|
</select>
|
|
<!-- insert area_ip_cfg表信息 -->
|
|
<insert id="saveAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
|
insert into area_ip_cfg (
|
|
CFG_DESC,
|
|
ACTION,
|
|
IS_VALID,
|
|
IS_AUDIT,
|
|
CREATOR_ID,
|
|
CREATE_TIME,
|
|
EDITOR_ID,
|
|
EDIT_TIME,
|
|
AUDITOR_ID,
|
|
AUDIT_TIME,
|
|
SERVICE_ID,
|
|
REQUEST_ID,
|
|
COMPILE_ID,
|
|
IS_AREA_EFFECTIVE,
|
|
CLASSIFY,
|
|
ATTRIBUTE,
|
|
LABLE,
|
|
AREA_EFFECTIVE_IDS,
|
|
function_id,
|
|
ip_type,
|
|
src_ip_address,
|
|
ip_pattern,
|
|
port_pattern,
|
|
src_port,
|
|
protocol,
|
|
protocol_id,
|
|
direction,
|
|
dest_port,
|
|
dest_ip_address,
|
|
cfg_type,
|
|
cfg_region_code
|
|
)values (
|
|
#{cfgDesc,jdbcType=VARCHAR},
|
|
#{action,jdbcType=INTEGER},
|
|
0,
|
|
0,
|
|
#{creatorId,jdbcType=INTEGER},
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
#{editorId,jdbcType=INTEGER},
|
|
#{editTime,jdbcType=TIMESTAMP},
|
|
#{auditorId,jdbcType=INTEGER},
|
|
#{auditTime,jdbcType=TIMESTAMP},
|
|
#{serviceId,jdbcType=INTEGER},
|
|
#{requestId,jdbcType=INTEGER},
|
|
#{compileId,jdbcType=INTEGER},
|
|
#{isAreaEffective,jdbcType=INTEGER},
|
|
#{classify,jdbcType=VARCHAR},
|
|
#{attribute,jdbcType=VARCHAR},
|
|
#{lable,jdbcType=VARCHAR},
|
|
#{areaEffectiveIds,jdbcType=VARCHAR},
|
|
#{functionId,jdbcType=INTEGER},
|
|
#{ipType,jdbcType=INTEGER},
|
|
#{srcIpAddress,jdbcType=VARCHAR},
|
|
#{ipPattern,jdbcType=INTEGER},
|
|
#{portPattern,jdbcType=INTEGER},
|
|
#{srcPort,jdbcType=VARCHAR},
|
|
#{protocol,jdbcType=INTEGER},
|
|
#{protocolId,jdbcType=INTEGER},
|
|
#{direction,jdbcType=INTEGER},
|
|
#{destPort,jdbcType=VARCHAR},
|
|
#{destIpAddress,jdbcType=VARCHAR},
|
|
#{cfgType,jdbcType=VARCHAR},
|
|
#{cfgRegionCode,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
|
|
<!-- update av_voip_ip_cfg表信息 -->
|
|
<update id="updateAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
|
update area_ip_cfg
|
|
<set >
|
|
<trim suffixOverrides=",">
|
|
<if test="cfgDesc != null and cfgDesc != ''" >
|
|
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="action != null" >
|
|
action = #{action,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isValid != null" >
|
|
is_valid = #{isValid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAudit != null" >
|
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="editorId != null" >
|
|
editor_id = #{editorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="editTime != null and editTime != ''" >
|
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="auditorId != null" >
|
|
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="auditTime != null and auditTime != ''" >
|
|
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="compileId != null" >
|
|
COMPILE_ID = #{compileId,jdbcType=TIMESTAMP},
|
|
</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="serviceId != null" >
|
|
service_id = #{serviceId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="ipType != null" >
|
|
ip_type = #{ipType,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
|
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="ipPattern != null" >
|
|
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="portPattern != null" >
|
|
port_pattern = #{portPattern,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="srcPort != null and srcPort != ''" >
|
|
src_port = #{srcPort,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="protocol != null" >
|
|
protocol = #{protocol,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="protocolId != null" >
|
|
protocol_id = #{protocolId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="direction != null" >
|
|
direction = #{direction,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="destPort != null and destPort != ''" >
|
|
dest_port = #{destPort,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="destIpAddress != null and destIpAddress != ''" >
|
|
dest_ip_address = #{destIpAddress,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="cfgType != null and cfgType != ''" >
|
|
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="cfgRegionCode != null " >
|
|
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
|
</if>
|
|
</trim>
|
|
</set>
|
|
<where>
|
|
<if test="cfgId != null" >
|
|
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="compileId != null" >
|
|
and compile_id = #{compileId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="functionId != null" >
|
|
and function_id = #{functionId,jdbcType=INTEGER}
|
|
</if>
|
|
</where>
|
|
</update>
|
|
<!-- 删除区域IP配置 -->
|
|
<delete id="deleteAreaIpCfg" >
|
|
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
|
</delete>
|
|
<update id="updateAreaIpCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
|
|
update area_ip_cfg
|
|
<set>
|
|
<if test="isValid != null" >
|
|
is_valid = #{isValid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isAudit != null" >
|
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
|
</if>
|
|
editor_id = #{editorId,jdbcType=INTEGER} ,
|
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
</set>
|
|
<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>
|
|
<!-- 删除区域IP配置 -->
|
|
<!-- 删除voipIp信息 -->
|
|
<delete id="deleteAreaIpCfgByCfgId" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
|
delete from area_ip_cfg where cfg_id = #{cfgId,jdbcType=INTEGER}
|
|
</delete>
|
|
</mapper> |