|
|
|
|
@@ -35,14 +35,17 @@
|
|
|
|
|
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
|
|
|
|
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
|
|
|
|
<result column="asn_ip_group" property="asnIpGroup" jdbcType="INTEGER" />
|
|
|
|
|
<result column="asn_ip_group_name" property="asnIpGroupName" jdbcType="VARCHAR" />
|
|
|
|
|
<!-- <result column="asn_ip_group_name" property="asnIpGroupName" jdbcType="VARCHAR" /> -->
|
|
|
|
|
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
|
|
|
|
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
|
|
|
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
|
|
|
|
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
|
|
|
|
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap id="varibleMap" type="com.nis.domain.basics.Varibles">
|
|
|
|
|
<result column="variable_name" property="variableName" jdbcType="VARCHAR" />
|
|
|
|
|
<result column="value" property="value" jdbcType="VARCHAR" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="columns">
|
|
|
|
|
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
|
|
|
|
|
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
|
|
|
|
|
@@ -58,10 +61,10 @@
|
|
|
|
|
<include refid="columns"></include>
|
|
|
|
|
<trim prefix="," prefixOverrides=",">
|
|
|
|
|
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
|
|
|
|
,asn.group_name as asn_ip_group_name
|
|
|
|
|
<!-- ,asn.group_name as asn_ip_group_name -->
|
|
|
|
|
</trim>
|
|
|
|
|
from asn_ip_cfg r
|
|
|
|
|
left join config_group_info asn on asn.group_id=r.asn_ip_group
|
|
|
|
|
<!-- left join config_group_info asn on asn.group_id=r.asn_ip_group -->
|
|
|
|
|
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
|
|
|
|
|
@@ -206,10 +209,10 @@
|
|
|
|
|
from asn_ip_cfg r
|
|
|
|
|
where r.cfg_id in (${ids}) and is_valid !=-1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getByAsnGroup" resultMap="asnIpCfgMap" parameterType="java.lang.Long" >
|
|
|
|
|
<select id="getByAsnNo" resultMap="asnIpCfgMap" parameterType="java.lang.Long" >
|
|
|
|
|
select
|
|
|
|
|
<include refid="columns"></include>
|
|
|
|
|
from asn_ip_cfg r where r.is_valid!=-1 and r.asn_ip_group=#{groupId} and r.user_region1=#{asnId}
|
|
|
|
|
from asn_ip_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId}
|
|
|
|
|
</select>
|
|
|
|
|
<insert id="insert" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
|
|
|
|
insert into asn_ip_cfg (
|
|
|
|
|
@@ -393,15 +396,18 @@
|
|
|
|
|
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
|
|
|
|
</where>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateValid" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
|
|
|
|
<!-- <update id="updateValid" parameterType="com.nis.domain.basics.AsnIpCfg" >
|
|
|
|
|
update asn_ip_cfg set is_valid=#{isValid} where cfg_id in (${ids})
|
|
|
|
|
</update>
|
|
|
|
|
</update> -->
|
|
|
|
|
<!-- <update id="deleteByAsnGroup" parameterType="java.lang.Integer" >
|
|
|
|
|
update asn_ip_cfg set is_valid=-1 where asn_ip_group=#{groupId} and user_region1=#{asnId}
|
|
|
|
|
</update> -->
|
|
|
|
|
<delete id="deleteByAsnGroup" parameterType="java.lang.Long" >
|
|
|
|
|
delete from asn_ip_cfg where asn_ip_group=#{groupId} and user_region1=#{asnId}
|
|
|
|
|
<delete id="deleteByAsnGroup" parameterType="java.lang.String" >
|
|
|
|
|
delete from asn_ip_cfg where user_region1 in(${asnId}) limit 10000
|
|
|
|
|
</delete>
|
|
|
|
|
<update id="delete" parameterType="java.lang.String" >
|
|
|
|
|
delete from asn_ip_cfg where cfg_id in (${ids})
|
|
|
|
|
</update>
|
|
|
|
|
<select id="findOtherIps" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
|
|
|
|
select 1 from asn_ip_cfg where is_valid=1 and asn_ip_group=#{groupId} and cfg_id !=#{cfgId} limit 1
|
|
|
|
|
</select>
|
|
|
|
|
@@ -411,8 +417,55 @@
|
|
|
|
|
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.String">
|
|
|
|
|
select count(1) from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${groups}) and cfg_id not in(${ids}) GROUP BY asn_ip_group;
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getInfoByAsnNo" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Long">
|
|
|
|
|
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
|
|
|
|
from config_group_info c where c.asn_id= #{asnId} and c.group_type=4
|
|
|
|
|
<select id="getVaribles" resultMap="varibleMap" parameterType="java.lang.String">
|
|
|
|
|
show VARIABLES like #{name}
|
|
|
|
|
</select>
|
|
|
|
|
<insert id="insertBatch">
|
|
|
|
|
INSERT INTO asn_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,region_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,
|
|
|
|
|
asn_ip_group,user_region1,user_region2,user_region3,user_region4,user_region5)
|
|
|
|
|
VALUES
|
|
|
|
|
<foreach collection ="list" item="asnIp" separator =",">
|
|
|
|
|
(#{asnIp.cfgDesc,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.action,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.isValid,jdbcType=INTEGER},
|
|
|
|
|
0,
|
|
|
|
|
#{asnIp.creatorId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{asnIp.editorId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.editTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{asnIp.auditorId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.auditTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{asnIp.serviceId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.requestId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.regionId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.isAreaEffective,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.classify,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.attribute,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.lable,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.areaEffectiveIds,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.functionId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.ipType,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.srcIpAddress,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.ipPattern,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.portPattern,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.srcPort,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.protocol,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.protocolId,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.direction,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.destPort,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.destIpAddress,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.cfgType,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.cfgRegionCode,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.asnIpGroup,jdbcType=INTEGER},
|
|
|
|
|
#{asnIp.userRegion1,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.userRegion2,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.userRegion3,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.userRegion4,jdbcType=VARCHAR},
|
|
|
|
|
#{asnIp.userRegion5,jdbcType=VARCHAR})
|
|
|
|
|
</foreach >
|
|
|
|
|
</insert>
|
|
|
|
|
</mapper>
|