asn 相关修改提交

(1)asn_ip_cfg增加四列
(2)新增asn_group_info表
(3)asn ip菜单移动到policy object下,新增审核审计菜单
(4)asn ip导入修改,适应新的需求放弃了使用AsnCache,直接从数据库查
(5)asn ip加入审核流程
(6)Packet IP选择asn时,改为选中一个组织,审核下发的配置为as号字符串域
(7)asn ip 新增业务新增function_service_dict字典,serviceId为400
This commit is contained in:
wangxin
2019-01-04 18:28:57 +06:00
parent 429b1841f1
commit 85507b5a55
44 changed files with 2596 additions and 767 deletions

View File

@@ -0,0 +1,32 @@
package com.nis.web.dao.basics;
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.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
List<AsnGroupInfo> findAsnGroupInfoList(AsnGroupInfo policyGroupInfo);
AsnGroupInfo getById(int id);
AsnGroupInfo getByGroupId(int groupId);
AsnGroupInfo getInfoByAsnNo(AsnGroupInfo policyGroupInfo);
Integer getGroupIdByOrganization(String organization);
AsnGroupInfo getGroupInfo(AsnGroupInfo policyGroupInfo);
AsnGroupInfo getGroupInfoByName(AsnGroupInfo policyGroupInfo);
int updateValid(AsnGroupInfo policyGroupInfo);
Integer getGroupIdByName(@Param("organization")String organization,@Param("country")String country);
AsnGroupInfo getGroupIdByNameAndASNId(@Param("organization")String organization,@Param("country")String country,@Param("asnId")Long asnId);
List<AsnGroupInfo> getConfigGroupInfoByGroupId(Integer groupId);
List<AsnGroupInfo> getConfigGroupInfoByName(@Param("organization")String organization);
List<AsnGroupInfo> getValidConfigGroupInfoByName(@Param("organization")String organization);
int getCountGroupInfoByName(@Param("organization")String organization);
void insertBatch(List<AsnGroupInfo> policyGroupInfos);
List<AsnGroupInfo> findAsnGroupInfos();
Long getCount();
void audit(AsnIpCfg t);
}

View File

@@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.basics.AsnGroupInfoDao" >
<resultMap id="AsnGroupInfoMap" type="com.nis.domain.basics.AsnGroupInfo" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="group_id" property="groupId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="organization" property="organization" jdbcType="VARCHAR" />
<result column="country" property="country" jdbcType="VARCHAR" />
<result column="detail" property="detail" jdbcType="VARCHAR" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<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" />
</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
</sql>
<!-- 查出所有 有效数据-->
<select id="findAsnGroupInfoList" resultMap="AsnGroupInfoMap">
SELECT
<include refid="AsnGroupInfoColumns"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name
,e.name as editor_name
</trim>
FROM asn_group_info r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="organization != null and organization != ''">
AND r.organization like concat(concat('%',#{organization,jdbcType=VARCHAR}),'%')
</if>
<if test="country != null and country != ''">
AND r.country like concat(concat('%',#{country,jdbcType=VARCHAR}),'%')
</if>
<if test="detail != null and detail != ''">
AND r.detail like concat(concat('%',#{detail,jdbcType=VARCHAR}),'%')
</if>
<if test="asnId != null and asnId != ''">
AND r.asn_id =#{asnId }
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<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>
<if test="isValid != null and isValid != ''">
AND r.is_valid =#{isValid }
</if>
AND r.is_valid !=-1
<!-- 数据范围过滤 -->
<!-- ${sqlMap.dsf} -->
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.group_id desc
</otherwise>
</choose>
</select>
<!-- 查出所有 有效数据-->
<select id="findAsnGroupInfos" resultMap="AsnGroupInfoMap">
SELECT
<include refid="AsnGroupInfoColumns"/>
FROM asn_group_info r where is_valid !=-1
</select>
<select id="getCount" resultType="java.lang.Long">
SELECT count(1)
FROM asn_group_info r where is_valid !=-1
</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
)values (
#{groupId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{organization,jdbcType=VARCHAR},
#{country,jdbcType=VARCHAR},
#{detail,jdbcType=VARCHAR},
#{isValid,jdbcType=INTEGER},
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{asnId,jdbcType=INTEGER},
#{orgGroupId,jdbcType=INTEGER}
)
</insert>
<update id="update" parameterType="com.nis.domain.basics.AsnGroupInfo" >
update asn_group_info
<set >
<trim suffixOverrides=",">
<if test="organization != null and organization !=''" >
organization = #{organization,jdbcType=VARCHAR},
</if>
<if test="country != null and country !=''" >
country = #{country,jdbcType=VARCHAR},
</if>
<if test="detail != null and detail !=''" >
detail = #{detail,jdbcType=VARCHAR},
</if>
<if test="asnId != null and asnId !=''" >
asn_id = #{asnId,jdbcType=INTEGER},
</if>
<if test="isValid != null and isValid !=''" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<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>
<if test="compileId != null and compileId !=''" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
</trim>
</set>
<where>
<trim suffixOverrides="and">
<if test="id != null" >
and id = #{id,jdbcType=INTEGER}
</if>
</trim>
</where>
</update>
<update id="updateValid" parameterType="com.nis.domain.basics.AsnGroupInfo" >
update asn_group_info
<set >
<trim suffixOverrides=",">
is_valid = #{isValid,jdbcType=INTEGER},
</trim>
</set>
<where>
<trim prefixOverrides="and">
<if test="groupId != null" >
and group_id = #{groupId,jdbcType=INTEGER}
</if>
<if test="id != null and id != ''" >
and id = #{id,jdbcType=INTEGER}
</if>
</trim>
</where>
</update>
<select id="getById" resultType="com.nis.domain.basics.AsnGroupInfo">
select <include refid="AsnGroupInfoColumns"/>
from asn_group_info r
where r.id =#{id}
</select>
<select id="getByGroupId" resultType="com.nis.domain.basics.AsnGroupInfo">
select <include refid="AsnGroupInfoColumns"/>
from asn_group_info r
where r.group_id =#{groupId} and is_valid !=-1
</select>
<select id="getGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
select <include refid="AsnGroupInfoColumns"/>
from asn_group_info r
where r.organization =#{organization}
<!-- and r.country =#{country} -->
and r.is_valid != -1 limit 1
</select>
<select id="getGroupIdByNameAndASNId" resultType="com.nis.domain.basics.AsnGroupInfo">
select <include refid="AsnGroupInfoColumns"/>
from asn_group_info r
where r.organization =#{organization}
<!-- and r.country =#{country} -->
and r.asn_id=#{asnId} and r.is_valid != -1 limit 1
</select>
<select id="getInfoByAsnNo" resultType="com.nis.domain.basics.AsnGroupInfo">
SELECT
<include refid="AsnGroupInfoColumns"/>
FROM
asn_group_info r
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="id != null" >
AND id != #{id,jdbcType=INTEGER}
</if>
<if test="groupId != null" >
AND group_id = #{groupId,jdbcType=INTEGER}
</if>
<if test="asnId != null" >
AND asn_id = #{asnId,jdbcType=BIGINT}
</if>
AND is_valid !=-1
</trim>
</select>
<select id="getConfigGroupInfoByGroupId" resultType="com.nis.domain.basics.AsnGroupInfo">
SELECT
<include refid="AsnGroupInfoColumns"/>
FROM
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 organization = #{organization,jdbcType=VARCHAR} AND is_valid !=-1
</select>
<select id="getValidConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
SELECT
<include refid="AsnGroupInfoColumns"/>
FROM
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1
</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
</select>
<select id="getGroupIdByOrganization" resultType="java.lang.Integer">
SELECT
r.group_id
FROM
asn_group_info r
WHERE
r.organization = #{organization}
</select>
<select id="getGroupInfo" resultType="com.nis.domain.basics.AsnGroupInfo">
SELECT
<include refid="AsnGroupInfoColumns"/>
FROM
asn_group_info r
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="organization != null and organization != ''" >
AND organization = #{organization,jdbcType=VARCHAR}
</if>
<if test="asnId != null" >
AND asn_id = #{asnId,jdbcType=INTEGER}
</if>
</trim>
</select>
</mapper>

View File

@@ -17,14 +17,16 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
public void updateIssued(AsnIpCfg cfg);
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<AsnIpCfg> findAllList(AsnIpCfg cfg);
// 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 List<AsnIpCfg> getByAsnNo(@Param("asnId")long asnNo);
public int deleteByAsnGroup(@Param("asnId")String asnNo);
public int deleteByAsnId(@Param("asnId")String asnNo);
public int insertBatch(List<AsnIpCfg> list);
public Varibles getVaribles(@Param("name")String name);
public void ajaxDeleteAsnIp(@Param("ids")String ids);
public int hasValidAsnIp(@Param("asnId")Long asnNo);
}

View File

@@ -41,11 +41,12 @@
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
<result column="organization" property="organization" jdbcType="VARCHAR" />
<result column="country" property="country" jdbcType="VARCHAR" />
<result column="detail" property="detail" jdbcType="VARCHAR" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
</resultMap>
<resultMap id="varibleMap" type="com.nis.domain.basics.Varibles">
<result column="variable_name" property="variableName" jdbcType="VARCHAR" />
<result column="value" property="value" jdbcType="VARCHAR" />
</resultMap>
<sql id="columns">
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
@@ -53,14 +54,14 @@
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
r.region_id,r.is_area_effective,r.classify,r.attribute,r.lable
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.asn_ip_group,r.user_region1
,r.user_region2,r.user_region3,r.user_region4,r.user_region5
,r.user_region2,r.user_region3,r.user_region4,r.user_region5,r.organization,r.country,r.detail,r.compile_id
</sql>
<select id="findPage" resultMap="asnIpCfgMap">
select
<include refid="columns"></include>
<trim prefix="," prefixOverrides=",">
,s.name as creator_name,e.name as editor_name,u.name as auditor_name,d.group_name as asnIpGroupName
,s.name as creator_name,e.name as editor_name,u.name as auditor_name<!-- ,d.group_name as asnIpGroupName -->
<!-- ,asn.group_name as asn_ip_group_name -->
</trim>
from asn_ip_cfg r
@@ -68,7 +69,6 @@
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join policy_group_info d on r.asn_ip_group = d.service_group_id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
@@ -175,6 +175,15 @@
<if test="functionId != null">
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="organization != null">
AND r.organization like concat(concat('%',#{organization,jdbcType=VARCHAR}),'%')
</if>
<if test="country != null">
AND r.country like concat(concat('%',#{country,jdbcType=VARCHAR}),'%')
</if>
<if test="detail != null">
AND r.detail like concat(concat('%',#{detail,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
@@ -230,6 +239,7 @@
SERVICE_ID,
REQUEST_ID,
region_id,
compile_id,
IS_AREA_EFFECTIVE,
CLASSIFY,
ATTRIBUTE,
@@ -253,12 +263,15 @@
user_region2,
user_region3,
user_region4,
user_region5
user_region5,
organization,
country,
detail
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},
0,
#{isAudit,jdbcType=INTEGER},
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
@@ -268,6 +281,7 @@
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{regionId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
@@ -291,7 +305,10 @@
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
#{userRegion5,jdbcType=VARCHAR},
#{organization,jdbcType=VARCHAR},
#{country,jdbcType=VARCHAR},
#{detail,jdbcType=VARCHAR}
)
</insert>
<update id="updateIssued" parameterType="com.nis.domain.basics.AsnIpCfg" >
@@ -387,6 +404,15 @@
</if>
<if test="cfgRegionCode != null " >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="organization != null " >
organization = #{organization,jdbcType=INTEGER},
</if>
<if test="country != null " >
country = #{country,jdbcType=INTEGER},
</if>
<if test="detail != null " >
detail = #{detail,jdbcType=INTEGER},
</if>
<if test="asnIpGroup != null " >
asn_ip_group = #{asnIpGroup,jdbcType=INTEGER},
@@ -403,12 +429,12 @@
<!-- <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> -->
<delete id="deleteByAsnGroup" parameterType="java.lang.String" >
<delete id="deleteByAsnId" parameterType="java.lang.String" >
delete from asn_ip_cfg where user_region1 in(${asnId}) limit 10000
</delete>
<update id="delete" parameterType="java.lang.String" >
<delete id="delete" parameterType="java.lang.String" >
delete from asn_ip_cfg where cfg_id in (${ids})
</update>
</delete>
<update id="ajaxDeleteAsnIp" parameterType="java.lang.String" >
delete from asn_ip_cfg where asn_ip_group in (${ids})
</update>
@@ -418,25 +444,25 @@
<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="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="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="getVaribles" resultMap="varibleMap" parameterType="java.lang.String">
show VARIABLES like #{name}
</select>
<insert id="insertBatch">
INSERT INTO asn_ip_cfg
(CFG_DESC,ACTION,IS_VALID,IS_AUDIT,CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,
AUDIT_TIME,SERVICE_ID,REQUEST_ID,region_id,IS_AREA_EFFECTIVE,CLASSIFY,ATTRIBUTE,LABLE,
AUDIT_TIME,SERVICE_ID,REQUEST_ID,region_id,compile_id,IS_AREA_EFFECTIVE,CLASSIFY,ATTRIBUTE,LABLE,
AREA_EFFECTIVE_IDS,function_id,ip_type,src_ip_address,ip_pattern,port_pattern,src_port,
protocol,protocol_id,direction,dest_port,dest_ip_address,cfg_type,cfg_region_code,
asn_ip_group,user_region1,user_region2,user_region3,user_region4,user_region5)
asn_ip_group,user_region1,user_region2,user_region3,user_region4,user_region5,organization,country,detail)
VALUES
<foreach collection ="list" item="asnIp" separator =",">
(#{asnIp.cfgDesc,jdbcType=VARCHAR},
#{asnIp.action,jdbcType=INTEGER},
#{asnIp.isValid,jdbcType=INTEGER},
0,
#{asnIp.isAudit,jdbcType=INTEGER},
#{asnIp.creatorId,jdbcType=INTEGER},
#{asnIp.createTime,jdbcType=TIMESTAMP},
#{asnIp.editorId,jdbcType=INTEGER},
@@ -446,6 +472,7 @@
#{asnIp.serviceId,jdbcType=INTEGER},
#{asnIp.requestId,jdbcType=INTEGER},
#{asnIp.regionId,jdbcType=INTEGER},
#{asnIp.compileId,jdbcType=INTEGER},
#{asnIp.isAreaEffective,jdbcType=INTEGER},
#{asnIp.classify,jdbcType=VARCHAR},
#{asnIp.attribute,jdbcType=VARCHAR},
@@ -469,17 +496,20 @@
#{asnIp.userRegion2,jdbcType=VARCHAR},
#{asnIp.userRegion3,jdbcType=VARCHAR},
#{asnIp.userRegion4,jdbcType=VARCHAR},
#{asnIp.userRegion5,jdbcType=VARCHAR})
#{asnIp.userRegion5,jdbcType=VARCHAR}),
#{asnIp.organization,jdbcType=VARCHAR}),
#{asnIp.country,jdbcType=VARCHAR}),
#{asnIp.detail,jdbcType=VARCHAR})
</foreach >
</insert>
<select id="hasValidAsnIp" resultType="java.lang.Integer">
select count(1) from asn_ip_cfg where is_valid=1 and user_region1=#{asnId}
</select>
<select id="findByPage" resultMap="asnIpCfgMap">
select
<include refid="columns"></include>
<trim prefix="," prefixOverrides=",">
,s.name as creator_name,e.name as editor_name,u.name as auditor_name,d.group_name as asnIpGroupName
,s.name as creator_name,e.name as editor_name,u.name as auditor_name<!-- ,d.group_name as asnIpGroupName -->
<!-- ,asn.group_name as asn_ip_group_name -->
</trim>
from asn_ip_cfg r
@@ -487,7 +517,7 @@
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join policy_group_info d on r.asn_ip_group = d.service_group_id
<!-- left join policy_group_info d on r.asn_ip_group = d.service_group_id -->
where r.CFG_ID in (${ids})
</select>

View File

@@ -275,8 +275,7 @@
update cfg_index_info set is_valid=#{isValid} where cfg_id in (${ids})
</update>
<select id="getConfigGroupInfoList" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
SELECT c.id,c.group_id,c.group_name,c.is_issued,c.insert_time,c.update_time,c.group_type,c.asn_id FROM (
SELECT DISTINCT asn_ip_group FROM asn_ip_cfg WHERE is_valid !=-1) a
LEFT JOIN config_group_info c ON a.asn_ip_group=c.group_id where c.group_type=#{groupType}
SELECT c.id,c.group_id,c.group_name,c.is_issued,c.insert_time,c.update_time,c.group_type,c.asn_id FROM
config_group_info c where c.group_name in (select DISTINCT organization from asn_group_info where is_valid=1)
</select>
</mapper>

View File

@@ -20,4 +20,7 @@ public interface ConfigGroupInfoDao extends CrudDao<ConfigGroupInfo>{
ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Long asnNo);
Integer getIssuedConfigGroupInfoByGroupIds(@Param("groupIds")String groupIds);
Long getCountByType(@Param("groupType")Integer groupType);
//获取asn组织的groupId
ConfigGroupInfo getAsnGroupByName(@Param("groupName")String groupName);
int delAsnGroup(@Param("groupName")String groupName);
}

View File

@@ -70,6 +70,10 @@
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
from config_group_info where group_id= #{groupId}
</select>
<select id="getAsnGroupByName" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.String">
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
from config_group_info where group_type=4 and group_name= #{groupName}
</select>
<!-- <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,compile_id,asn_id
from config_group_info c where c.group_type= #{groupType}
@@ -80,4 +84,7 @@
<select id="getCountByType" resultType="java.lang.Long" parameterType="java.lang.Integer">
select count(1) from config_group_info c where c.group_type=${groupType}
</select>
<delete id="delAsnGroup" parameterType="java.lang.String">
delete from config_group_info where group_name=#{groupName} and group_type=4
</delete>
</mapper>