(1)asn导入加入组织国家,asn号验证,组织国家不能为空,asn号不能为两个组织所有
(2)新增asn_keyword_cfg表,用于保存并下发有效且含审核通过asn ip的 asn号 (3)asn 导入去除条数限制 (4)页面asn select选项还是会影响加载页面速度,现在改为input (5)asn_group_info 修改org_group_id为issued_ips,用于保存审核通过的asn ip (6)分组复用url配置文件补全v1
This commit is contained in:
@@ -12,7 +12,7 @@ import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
||||
List<AsnGroupInfo> findAsnGroupInfoList(AsnGroupInfo policyGroupInfo);
|
||||
AsnGroupInfo getById(int id);
|
||||
AsnGroupInfo getById(long id);
|
||||
AsnGroupInfo getByGroupId(int groupId);
|
||||
AsnGroupInfo getInfoByAsnNo(AsnGroupInfo policyGroupInfo);
|
||||
Integer getGroupIdByOrganization(String organization);
|
||||
@@ -28,5 +28,5 @@ public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
||||
void insertBatch(List<AsnGroupInfo> policyGroupInfos);
|
||||
List<AsnGroupInfo> findAsnGroupInfos();
|
||||
Long getCount();
|
||||
void audit(AsnIpCfg t);
|
||||
void modifyIssuedIp(AsnGroupInfo info);
|
||||
}
|
||||
@@ -14,11 +14,11 @@
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="asn_id" property="asnId" jdbcType="BIGINT" />
|
||||
<result column="org_group_id" property="orgGroupId" jdbcType="INTEGER" />
|
||||
<result column="issued_ips" property="issuedIPs" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<sql id="AsnGroupInfoColumns">
|
||||
r.id,r.group_id,r.compile_id,r.organization,r.country,r.detail,r.is_valid,r.create_time,r.edit_time,
|
||||
r.creator_id,r.editor_id,r.asn_id,r.org_group_id
|
||||
r.creator_id,r.editor_id,r.asn_id,r.issued_ips
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
@@ -55,8 +55,8 @@
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="orgGroupId != null and orgGroupId != ''">
|
||||
AND r.org_group_id =#{orgGroupId }
|
||||
<if test="issuedIPs != null and issuedIPs != ''">
|
||||
AND r.issued_ips =#{issuedIPs }
|
||||
</if>
|
||||
<if test="isValid != null and isValid != ''">
|
||||
AND r.is_valid =#{isValid }
|
||||
@@ -87,7 +87,7 @@
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||
insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id,org_group_id
|
||||
insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id
|
||||
)values (
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
@@ -99,8 +99,7 @@
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{asnId,jdbcType=INTEGER},
|
||||
#{orgGroupId,jdbcType=INTEGER}
|
||||
#{asnId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -126,8 +125,8 @@
|
||||
<if test="groupId != null and groupId !=''" >
|
||||
group_id = #{groupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orgGroupId != null and orgGroupId !=''" >
|
||||
org_group_id = #{orgGroupId,jdbcType=INTEGER},
|
||||
<if test="issuedIPs != null" >
|
||||
issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="compileId != null and compileId !=''" >
|
||||
compile_id = #{compileId,jdbcType=INTEGER},
|
||||
@@ -153,6 +152,9 @@
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
<if test="issuedIPs != null" >
|
||||
issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
@@ -160,9 +162,37 @@
|
||||
<if test="groupId != null" >
|
||||
and group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnId != null" >
|
||||
and asn_id = #{asnId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="id != null and id != ''" >
|
||||
and id = #{id,jdbcType=INTEGER}
|
||||
</if>
|
||||
and is_valid != -1
|
||||
</trim>
|
||||
</where>
|
||||
</update>
|
||||
<update id="modifyIssuedIp" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||
update asn_group_info
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="issuedIPs != null" >
|
||||
issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
<trim prefixOverrides="and">
|
||||
<if test="groupId != null" >
|
||||
and group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnId != null and asnId != ''" >
|
||||
and asn_id = #{asnId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="id != null and id != ''" >
|
||||
and id = #{id,jdbcType=INTEGER}
|
||||
</if>
|
||||
and is_valid != -1
|
||||
</trim>
|
||||
</where>
|
||||
</update>
|
||||
@@ -225,7 +255,7 @@
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1
|
||||
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1 AND issued_ips>0
|
||||
</select>
|
||||
<select id="getCountGroupInfoByName" resultType="java.lang.Integer">
|
||||
SELECT count(1) FROM asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid !=-1
|
||||
|
||||
@@ -18,6 +18,7 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public List<AsnIpCfg> getByIds(@Param("ids")String ids);
|
||||
public List<Integer> hasGroupIds(@Param("ids")String ids);
|
||||
public List<Integer> hasASNIds(@Param("ids")String ids);
|
||||
public List<Integer> hasASNIpAddrs(@Param("ids")String ids);
|
||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
@@ -29,4 +30,6 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public Varibles getVaribles(@Param("name")String name);
|
||||
public void ajaxDeleteAsnIp(@Param("ids")String ids);
|
||||
public int hasValidAsnIp(@Param("asnId")Long asnNo);
|
||||
public AsnIpCfg getOne(AsnIpCfg cfg);
|
||||
public void updateAsn(@Param("asnId")String asnNo,@Param("organization")String organization,@Param("country")String country,@Param("detail")String detail);
|
||||
}
|
||||
|
||||
@@ -204,6 +204,101 @@
|
||||
from asn_ip_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="getOne" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="asnIpGroup != null and asnIpGroup != ''">
|
||||
AND r.asn_Ip_Group =#{asnIpGroup,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE =#{cfgType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<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}
|
||||
</if>
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<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}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="regionId != null">
|
||||
AND r.region_id=#{regionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="organization != null">
|
||||
AND r.organization =#{organization,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="country != null">
|
||||
AND r.country =#{country,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="detail != null">
|
||||
AND r.detail =#{detail,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</trim>
|
||||
limit 1
|
||||
</select>
|
||||
<select id="findAllList" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
@@ -417,6 +512,9 @@
|
||||
<if test="asnIpGroup != null " >
|
||||
asn_ip_group = #{asnIpGroup,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
@@ -437,6 +535,9 @@
|
||||
</delete>
|
||||
<update id="ajaxDeleteAsnIp" parameterType="java.lang.String" >
|
||||
delete from asn_ip_cfg where asn_ip_group in (${ids})
|
||||
</update>
|
||||
<update id="updateAsn" parameterType="java.lang.String" >
|
||||
update asn_ip_cfg set organization=#{organization}, country=#{country}, detail=#{detail} where user_region1 =#{asnId} and is_valid=0
|
||||
</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
|
||||
@@ -447,6 +548,9 @@
|
||||
<select id="hasASNIds" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_ip_cfg where is_valid !=-1 and is_audit=1 and user_region1 in(${ids}) limit 1
|
||||
</select>
|
||||
<select id="hasASNIpAddrs" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_keyword_cfg where is_valid !=-1 and is_audit=1 and cfg_keywords in(${ids}) limit 1
|
||||
</select>
|
||||
<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>
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
@@ -45,7 +46,9 @@ public interface StringCfgDao extends CrudDao<BaseStringCfg>{
|
||||
public void deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds);
|
||||
public List<NtcSubscribeIdCfg> findSubscribeIdCfgListByCfgIndexInfo(CfgIndexInfo entity);
|
||||
public void deleteSubscribeIdCfgByCfgIndexInfo(CfgIndexInfo entity);
|
||||
public void deleteAsnKeyword(CfgIndexInfo entity);
|
||||
public List<NtcSubscribeIdCfg> findSubscribeIdCfgList(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
public List<AsnKeywordCfg> findAsnKeywordCfgList(CfgIndexInfo entity);
|
||||
public void saveSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
public void updateSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
public void deleteSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
<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>
|
||||
<resultMap id="AsnKeywordMap" type="com.nis.domain.configuration.AsnKeywordCfg" extends="BaseStringMap">
|
||||
</resultMap>
|
||||
<resultMap id="SubscribeIdCfgMap" type="com.nis.domain.configuration.NtcSubscribeIdCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -77,6 +79,12 @@
|
||||
r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id,
|
||||
r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code
|
||||
</sql>
|
||||
<sql id="AsnKeywordCfg_Column">
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.cfg_type,
|
||||
r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id,
|
||||
r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code,r.user_region1,r.user_region2,r.user_region3,r.user_region4,r.user_region5
|
||||
</sql>
|
||||
<!-- <sql id="BaseStringCfg_Column_List_with_id_alias" >
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords, r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
@@ -716,6 +724,19 @@
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="findAsnKeywordCfgList" resultMap="AsnKeywordMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
select
|
||||
<include refid="AsnKeywordCfg_Column" />
|
||||
from asn_keyword_cfg r
|
||||
<where>
|
||||
<if test="functionId != null">
|
||||
and r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
and r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!-- 删除voip subscribe信息 -->
|
||||
<delete id="deleteSubscribeIdCfgByCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
delete from ntc_subscribe_id_cfg
|
||||
@@ -731,6 +752,17 @@
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
<delete id="deleteAsnKeyword" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
delete from asn_keyword_cfg
|
||||
<where>
|
||||
<if test="compileId != null" >
|
||||
and compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
and function_id = #{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
<!-- =====================NtcSubscribeIdCfg end======================== -->
|
||||
|
||||
<insert id="saveStringCfgBatch" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||
|
||||
Reference in New Issue
Block a user