Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git
into develop Conflicts: src/main/java/com/nis/web/service/BaseService.java asn group中修改组织变更和asn no变更,不重新获取groupId逻辑 ip addr 的asn 修改为手动输入,后台check app ip和asn ip配置取消,取消分组中最后一条配置时,失效整个compile,并且修改groupId的状态为为无效。 无效的asn group删除时,删除其下的所有asn ip
This commit is contained in:
@@ -30,6 +30,6 @@ public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
||||
Long getCount();
|
||||
void modifyIssuedIp(AsnGroupInfo info);
|
||||
List<AsnGroupInfo> findAsnGroupInfoByAsnGroup(AsnGroupInfo asnGroupInfo);
|
||||
void updateIsUsedAndIsValid(@Param("asnNos")List asnNos,@Param("isUsed")Integer isUsed,@Param("isValid")Integer isValid);
|
||||
List<AsnGroupInfo> findAsnGroupInfoByAsnNos(@Param("asnNos")List asnNos,@Param("isUsed")Integer isUsed);
|
||||
void updateIsUsedAndIsValid(@Param("groupIds")List groupIds,@Param("isUsed")Integer isUsed,@Param("isValid")Integer isValid);
|
||||
List<AsnGroupInfo> findAsnGroupInfoByGroupIds(@Param("groupIds")List groupIds,@Param("isUsed")Integer isUsed);
|
||||
}
|
||||
@@ -17,10 +17,11 @@
|
||||
<result column="issued_ips" property="issuedIPs" jdbcType="INTEGER" />
|
||||
<result column="is_used" property="isUsed" jdbcType="INTEGER" />
|
||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
||||
<result column="org_group_id" property="orgGroupId" 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.issued_ips,r.is_used,r.region_id
|
||||
r.creator_id,r.editor_id,r.asn_id,r.issued_ips,r.is_used,r.region_id,r.org_group_id
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
@@ -62,6 +63,9 @@
|
||||
</if>
|
||||
<if test="isValid != null and isValid != ''">
|
||||
AND r.is_valid =#{isValid }
|
||||
</if>
|
||||
<if test="orgGroupId != null and orgGroupId != ''">
|
||||
AND r.org_group_id =#{orgGroupId }
|
||||
</if>
|
||||
AND r.is_valid !=-1
|
||||
<!-- 数据范围过滤 -->
|
||||
@@ -102,7 +106,8 @@
|
||||
edit_time,
|
||||
asn_id,
|
||||
is_used,
|
||||
region_id
|
||||
region_id,
|
||||
org_group_id
|
||||
)values (
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
@@ -116,7 +121,8 @@
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{asnId,jdbcType=INTEGER},
|
||||
#{isUsed,jdbcType=INTEGER},
|
||||
#{regionId,jdbcType=INTEGER}
|
||||
#{regionId,jdbcType=INTEGER},
|
||||
#{orgGroupId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -159,6 +165,9 @@
|
||||
</if>
|
||||
<if test="regionId != null" >
|
||||
region_id = #{regionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orgGroupId != null" >
|
||||
org_group_id = #{orgGroupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
@@ -181,10 +190,10 @@
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="asnNos != null" >
|
||||
and asn_id in
|
||||
<foreach collection ="asnNos" item="asnId" separator ="," open="(" close=")">
|
||||
#{asnId}
|
||||
<if test="groupIds != null" >
|
||||
and group_id in
|
||||
<foreach collection ="groupIds" item="groupId" separator ="," open="(" close=")">
|
||||
#{groupId}
|
||||
</foreach >
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
@@ -351,7 +360,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="findAsnGroupInfoByAsnNos" resultMap="AsnGroupInfoMap">
|
||||
<select id="findAsnGroupInfoByGroupIds" resultMap="AsnGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
@@ -360,11 +369,11 @@
|
||||
<if test="isUsed != null" >
|
||||
AND r.is_used = #{isUsed,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnNos != null" >
|
||||
and r.asn_id in
|
||||
<foreach collection ="asnNos" item="asnId" separator ="," open="(" close=")">
|
||||
#{asnId}
|
||||
</foreach >
|
||||
<if test="groupIds != null" >
|
||||
and r.group_id in
|
||||
<foreach collection ="groupIds" item="groupId" separator ="," open="(" close=")">
|
||||
#{groupId}
|
||||
</foreach >
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -33,6 +33,6 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
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);
|
||||
public void updateAsn(@Param("asnId")String asnNo,@Param("organization")String organization,@Param("country")String country,@Param("detail")String detail,@Param("groupId")String groupId);
|
||||
public void updateAsnIpByAsnGroups(@Param("entity")AsnIpCfg entity,@Param("asnGroups")List<AsnGroupInfo> asnGroups,@Param("asnIds")String asnIds);
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
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 asn_ip_cfg set organization=#{organization}, country=#{country}, detail=#{detail},user_region1 =#{asnId} where asn_ip_group =#{groupId} 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
|
||||
|
||||
@@ -123,4 +123,6 @@ public interface AppCfgDao {
|
||||
|
||||
//app ssl证书特征配置CRUD
|
||||
public List<AppSslCertCfg> findAppBySslList(@Param("ids")String ids);
|
||||
//查找此分组下是否有App IP
|
||||
public List<AppIpCfg> findAppIpByCompileId(@Param("compileId")Integer compileId) ;
|
||||
}
|
||||
|
||||
@@ -3109,4 +3109,7 @@
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
where r.CFG_ID in (${ids})
|
||||
</select>
|
||||
<select id="findAppIpByCompileId" resultMap="AppIpCfgMap">
|
||||
select * from app_ip_cfg where is_valid=1 and compile_Id = #{compileId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -130,4 +130,21 @@
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
<update id="update" >
|
||||
UPDATE config_group_info
|
||||
<set>
|
||||
update_time=now(),
|
||||
<if test="groupName != null and groupName != ''">
|
||||
group_name =#{groupName},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="groupType != null">
|
||||
and group_type =#{groupType}
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
and group_id =#{groupId}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user