(1)ans ip导入开发

(2)asn 导入模板修改asnNo为userRegion1
(3)加入导入是否全量开关,如果全量,会删除对应asn号下的所有IP,如果已下发,还得分组复用删除域
(4)优化效率,asn ip region获取region id改为批量
This commit is contained in:
wangxin
2018-10-26 18:57:20 +08:00
parent b5c4e542cd
commit 95c4c49f97
12 changed files with 250 additions and 99 deletions

View File

@@ -16,7 +16,10 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
public List<AsnIpCfg> getByIds(@Param("ids")String ids);
public List<Integer> hasGroupIds(@Param("ids")String ids);
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
public ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Integer asnNo);
public List<AsnIpCfg> getByAsnGroup(@Param("groupId")Integer groupId,@Param("asnId")Integer asnNo);
public void deleteByAsnGroup(@Param("groupId")Integer groupId,@Param("asnId")Integer asnNo);
}

View File

@@ -206,7 +206,11 @@
from asn_ip_cfg r
where r.cfg_id in (${ids}) and is_valid !=-1
</select>
<select id="getByAsnGroup" resultMap="asnIpCfgMap" parameterType="java.lang.Integer" >
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}
</select>
<insert id="insert" parameterType="com.nis.domain.basics.AsnIpCfg" >
insert into asn_ip_cfg (
CFG_DESC,
@@ -392,18 +396,20 @@
<update id="updateValid" parameterType="com.nis.domain.basics.AsnIpCfg" >
update asn_ip_cfg set is_valid=#{isValid} where cfg_id in (${ids})
</update>
<select id="findPolicyGroupInfosByType" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
select id,group_id,group_name,is_issued,insert_time,update_time,group_type
from config_group_info c where c.group_type= #{groupId}
</select>
<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>
<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>
<select id="hasGroupIds" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select 1 from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${ids}) limit 1
</select>
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.Integer">
<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.Integer">
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>
</mapper>