ASN 版本恢复1月4号之版本
This commit is contained in:
@@ -29,7 +29,4 @@ public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
||||
List<AsnGroupInfo> findAsnGroupInfos();
|
||||
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);
|
||||
}
|
||||
@@ -15,12 +15,10 @@
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="asn_id" property="asnId" jdbcType="BIGINT" />
|
||||
<result column="issued_ips" property="issuedIPs" jdbcType="INTEGER" />
|
||||
<result column="is_used" property="isUsed" jdbcType="INTEGER" />
|
||||
<result column="region_id" property="regionId" 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
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
@@ -81,7 +79,7 @@
|
||||
<select id="findAsnGroupInfos" resultMap="AsnGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM asn_group_info r where r.is_valid !=-1
|
||||
FROM asn_group_info r where is_valid !=-1
|
||||
</select>
|
||||
<select id="getCount" resultType="java.lang.Long">
|
||||
SELECT count(1)
|
||||
@@ -89,20 +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,
|
||||
is_used,
|
||||
region_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},
|
||||
@@ -114,9 +99,7 @@
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{asnId,jdbcType=INTEGER},
|
||||
#{isUsed,jdbcType=INTEGER},
|
||||
#{regionId,jdbcType=INTEGER}
|
||||
#{asnId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -154,12 +137,6 @@
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="isUsed != null" >
|
||||
is_used = #{isUsed,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="regionId != null" >
|
||||
region_id = #{regionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
@@ -170,28 +147,6 @@
|
||||
</trim>
|
||||
</where>
|
||||
</update>
|
||||
<update id="updateIsUsedAndIsValid" >
|
||||
update asn_group_info
|
||||
<set >
|
||||
<if test="isUsed != null" >
|
||||
is_used = #{isUsed,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="asnNos != null" >
|
||||
and asn_id in
|
||||
<foreach collection ="asnNos" item="asnId" separator ="," open="(" close=")">
|
||||
#{asnId}
|
||||
</foreach >
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
and is_valid != #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
<update id="updateValid" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||
update asn_group_info
|
||||
<set >
|
||||
@@ -250,7 +205,7 @@
|
||||
<select id="getByGroupId" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||
select <include refid="AsnGroupInfoColumns"/>
|
||||
from asn_group_info r
|
||||
where r.group_id =#{groupId} and r.is_valid !=-1
|
||||
where r.group_id =#{groupId} and is_valid !=-1
|
||||
</select>
|
||||
<select id="getGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||
select <include refid="AsnGroupInfoColumns"/>
|
||||
@@ -288,13 +243,13 @@
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
asn_group_info r WHERE r.group_id = #{groupId,jdbcType=INTEGER} AND r.is_valid !=-1
|
||||
asn_group_info r WHERE group_id = #{groupId,jdbcType=INTEGER} AND is_valid !=-1
|
||||
</select>
|
||||
<select id="getConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
asn_group_info r WHERE r.organization = #{organization,jdbcType=VARCHAR} AND r.is_valid !=-1
|
||||
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid !=-1
|
||||
</select>
|
||||
<select id="getValidConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||
SELECT
|
||||
@@ -323,49 +278,11 @@
|
||||
asn_group_info r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="organization != null and organization != ''" >
|
||||
AND r.organization = #{organization,jdbcType=VARCHAR}
|
||||
AND organization = #{organization,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="asnId != null" >
|
||||
AND r.asn_id = #{asnId,jdbcType=INTEGER}
|
||||
AND asn_id = #{asnId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<select id="findAsnGroupInfoByAsnGroup" resultMap="AsnGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
asn_group_info r
|
||||
<where>
|
||||
<if test="asnId != null" >
|
||||
AND r.asn_id = #{asnId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isUsed != null" >
|
||||
AND r.is_used = #{isUsed,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="organization != null and organization != ''" >
|
||||
AND r.organization = #{organization,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
AND r.is_valid = #{isValid,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="findAsnGroupInfoByAsnNos" resultMap="AsnGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
asn_group_info r
|
||||
<where>
|
||||
<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>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.Varibles;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
@@ -21,7 +20,6 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public List<Integer> hasASNIds(@Param("ids")String ids);
|
||||
public List<Integer> hasASNIpAddrs(@Param("ids")String ids);
|
||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||
public List<AsnIpCfg> findAllListByAsnGroup(@Param("entity")AsnIpCfg entity,@Param("asnGroups")List<AsnGroupInfo> asnGroups,@Param("asnIds")String asnIds);
|
||||
// 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);
|
||||
@@ -34,5 +32,4 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
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 updateAsnIpByAsnGroups(@Param("entity")AsnIpCfg entity,@Param("asnGroups")List<AsnGroupInfo> asnGroups,@Param("asnIds")String asnIds);
|
||||
}
|
||||
|
||||
@@ -308,26 +308,6 @@
|
||||
AND r.asn_ip_group =#{asnIpGroup}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findAllListByAsnGroup" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r
|
||||
<where>
|
||||
and is_valid=#{entity.isValid,jdbcType=INTEGER}
|
||||
and is_audit=#{entity.isAudit,jdbcType=INTEGER}
|
||||
<if test=" asnGroups != null">
|
||||
and r.user_region1 in
|
||||
<foreach collection ="asnGroups" item="asnGroup" separator ="," open="(" close=")">
|
||||
#{asnGroup.asnId,jdbcType=INTEGER}
|
||||
</foreach >
|
||||
</if>
|
||||
<if test=" asnIds != null and asnIds !=''">
|
||||
and r.user_region1 in (select asn_id from asn_group_info where asn_id in(${asnIds}) and is_used=0)
|
||||
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="getByIds" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
@@ -647,26 +627,6 @@
|
||||
<!-- left join policy_group_info d on r.asn_ip_group = d.service_group_id -->
|
||||
where r.CFG_ID in (${ids})
|
||||
</select>
|
||||
<update id="updateAsnIpByAsnGroups" >
|
||||
update asn_ip_cfg set
|
||||
<if test=" asnIds != null and asnIds !=''">
|
||||
is_valid=#{entity.isValid} ,
|
||||
is_audit=#{entity.isAudit},
|
||||
</if>
|
||||
AUDITOR_ID = #{entity.auditorId,jdbcType=INTEGER}
|
||||
,AUDIT_TIME = #{entity.auditTime,jdbcType=TIMESTAMP}
|
||||
<where>
|
||||
<if test=" asnGroups != null">
|
||||
and user_region1 in
|
||||
<foreach collection ="asnGroups" item="asnGroup" separator ="," open="(" close=")">
|
||||
#{asnGroup.asnId,jdbcType=INTEGER}
|
||||
</foreach >
|
||||
</if>
|
||||
<if test=" asnIds != null and asnIds !=''">
|
||||
and user_region1 in (select asn_id from asn_group_info where asn_id in(${asnIds}) and is_used=0)
|
||||
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user