dnat复用策略提交.
This commit is contained in:
@@ -4,6 +4,8 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
|
||||
import com.nis.domain.configuration.IpReusePolicyCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@@ -24,7 +26,19 @@ public interface IpMultiplexDao extends CrudDao<IpMultiplexDao>{
|
||||
|
||||
// 校验地址池是否被引用
|
||||
List<IpReusePolicyCfg> checkAddrPoolIsUsed(@Param("addrPoolId")String addrPoolId);
|
||||
|
||||
|
||||
// SNAT策略更新审核状态
|
||||
void updatePolicyAuditStatus(IpReusePolicyCfg cfg);
|
||||
|
||||
// DNAT策略更新审核状态
|
||||
void updateDnatPolicyStatus(IpReuseDnatPolicyCfg cfg);
|
||||
|
||||
void saveDnatPolicyCfg(IpReuseDnatPolicyCfg entity);
|
||||
|
||||
void updateDnatPolicyCfg(IpReuseDnatPolicyCfg entity);
|
||||
|
||||
List<BaseIpCfg> findPageDnat(IpReuseDnatPolicyCfg entity);
|
||||
|
||||
List<IpReuseDnatPolicyCfg> findDnatList(@Param("cfgId")Long cfgId, @Param("isValid")Integer isValid);
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,41 @@
|
||||
<result column="cancel_request_id" property="cancelRequestId" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="dnatPolicyMap" type="com.nis.domain.configuration.IpReuseDnatPolicyCfg" >
|
||||
<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="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
|
||||
<result column="translated_dest_ip" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="original_dest_ip" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="translated_dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
<result column="original_dest_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
<result column="direction" property="direction" jdbcType="INTEGER" />
|
||||
<result column="protocol" property="protocol" jdbcType="INTEGER" />
|
||||
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="policyColumns">
|
||||
r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_NAME,r.USER_TYPE,r.IP_TYPE,r.IP_PATTERN,r.SRC_IP_ADDRESS,
|
||||
r.ACTION,r.DO_LOG,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID,
|
||||
@@ -49,6 +84,15 @@
|
||||
r.USER_REGION1,r.USER_REGION2,r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
|
||||
</sql>
|
||||
|
||||
<sql id="dnatPolicyColumns" >
|
||||
a.cfg_id,a.cfg_desc,a.ip_type,a.original_dest_ip,a.ip_pattern,a.port_pattern,a.original_dest_port,
|
||||
a.protocol,a.protocol_id,a.cfg_type,a.action,a.translated_dest_port,a.translated_dest_ip,a.is_valid,
|
||||
a.is_audit,a.creator_id,a.create_time,a.editor_id,a.edit_time,a.auditor_id,a.audit_time,
|
||||
a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
||||
a.area_effective_ids,a.function_id,a.cfg_region_code,a.user_region1,a.user_region2,
|
||||
a.user_region3,a.user_region4,a.user_region5
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="policyMap">
|
||||
SELECT
|
||||
<include refid="policyColumns"/>
|
||||
@@ -75,7 +119,10 @@
|
||||
<if test="cfgId != null">
|
||||
AND r.cfg_id=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.cfg_desc like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
@@ -94,10 +141,7 @@
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
@@ -362,4 +406,307 @@
|
||||
WHERE
|
||||
r.addr_pool_id = #{addrPoolId} AND r.is_valid != -1
|
||||
</select>
|
||||
|
||||
<update id="updateDnatPolicyStatus" parameterType="com.nis.domain.configuration.IpReuseDnatPolicyCfg">
|
||||
update ip_reuse_dnat_policy
|
||||
<set>
|
||||
<trim suffixOverrides=",">
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null and createTime != ''" >
|
||||
audit_time = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
WHERE cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<insert id="saveDnatPolicyCfg" parameterType="com.nis.domain.configuration.IpReuseDnatPolicyCfg">
|
||||
INSERT INTO ip_reuse_dnat_policy (
|
||||
cfg_desc,
|
||||
ip_type,
|
||||
ip_pattern,
|
||||
port_pattern,
|
||||
original_dest_ip,
|
||||
original_dest_port,
|
||||
translated_dest_ip,
|
||||
translated_dest_port,
|
||||
protocol,
|
||||
protocol_id,
|
||||
is_valid,
|
||||
is_audit,
|
||||
do_log,
|
||||
action,
|
||||
service_id,
|
||||
function_id,
|
||||
compile_id,
|
||||
is_area_effective,
|
||||
area_effective_ids,
|
||||
creator_id,
|
||||
create_time,
|
||||
editor_id,
|
||||
edit_time,
|
||||
auditor_id,
|
||||
audit_time,
|
||||
request_id,
|
||||
classify,
|
||||
attribute,
|
||||
lable,
|
||||
cfg_region_code,
|
||||
cfg_type,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)VALUES (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{ipPattern,jdbcType=INTEGER},
|
||||
#{portPattern,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{doLog,jdbcType=INTEGER},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDnatPolicyCfg" parameterType="com.nis.domain.configuration.IpReuseDnatPolicyCfg">
|
||||
update ip_reuse_dnat_policy
|
||||
<set>
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ipType != null" >
|
||||
ip_type = #{ipType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ipPattern != null">
|
||||
ip_pattern=#{ipPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="portPattern != null">
|
||||
port_pattern=#{portPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpAddress != null">
|
||||
original_dest_ip=#{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
translated_dest_ip=#{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
original_dest_port=#{srcPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
translated_dest_port=#{destPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="protocol != null" >
|
||||
protocol = #{protocol,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="protocolId != null" >
|
||||
protocol_id = #{protocolId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doLog != null" >
|
||||
do_log = #{doLog,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null" >
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<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 createTime != ''" >
|
||||
audit_time = #{auditTime,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>
|
||||
</trim>
|
||||
</set>
|
||||
WHERE cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
|
||||
</update>
|
||||
|
||||
<select id="findPageDnat" resultMap="dnatPolicyMap">
|
||||
SELECT
|
||||
<include refid="dnatPolicyColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name,
|
||||
e.name as editor_name,
|
||||
u.name as auditor_name,
|
||||
ri.request_title as requestName
|
||||
</trim>
|
||||
FROM
|
||||
ip_reuse_dnat_policy 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="compileId != null">
|
||||
AND a.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND a.original_dest_ip=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND a.translated_dest_ip=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND a.original_dest_port=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND a.translated_dest_port=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND a.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND a.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
AND a.CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND a.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName != ''">
|
||||
AND a.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="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="functionId != null">
|
||||
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY a.cfg_id DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<!-- 获取数据跳转表单 -->
|
||||
<select id="findDnatList" resultMap="dnatPolicyMap">
|
||||
SELECT
|
||||
<include refid="dnatPolicyColumns"/>
|
||||
FROM
|
||||
ip_reuse_dnat_policy a
|
||||
<where>
|
||||
<if test="cfgId != null">
|
||||
AND a.cfg_id=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="isValid !=null">
|
||||
AND a.is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid ==null">
|
||||
AND a.is_valid != -1
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.cfg_id
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user