去掉分组管理无用代码
This commit is contained in:
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@@ -19,17 +18,4 @@ public interface CommonGroupManageDao extends CrudDao<CommonGroupInfo> {
|
||||
|
||||
List<CommonGroupInfo> findGroupInfoList(@Param("ids")String ids);
|
||||
|
||||
/*List<PolicyGroupInfo> findPolicyGroupInfos();
|
||||
List<PolicyGroupInfo> findHasIPPolicyGroupInfosByType(int groupType);
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosHasIpRegionByType(int groupType);
|
||||
List<PolicyGroupInfo> findNatPolicyGroups();
|
||||
|
||||
PolicyGroupInfo getInfoByAsnNo(PolicyGroupInfo policyGroupInfo);
|
||||
List<PolicyGroupInfo> getHasAreaPolicyGroups(int groupType);
|
||||
int insertBatch(List<PolicyGroupInfo> list);
|
||||
|
||||
Integer getGroupIdByGroupName(String groupName);
|
||||
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||
|
||||
*/
|
||||
}
|
||||
@@ -2,25 +2,25 @@
|
||||
<!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.CommonGroupManageDao" >
|
||||
|
||||
<resultMap id="CommonGroupInfoMap" type="com.nis.domain.basics.CommonGroupInfo" >
|
||||
<id column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||
<result column="group_type" property="groupType" jdbcType="INTEGER" />
|
||||
<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="service_group_id" property="serviceGroupId" jdbcType="INTEGER" />
|
||||
<result column="description" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<resultMap id="CommonGroupInfoMap" type="com.nis.domain.basics.CommonGroupInfo" >
|
||||
<id column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||
<result column="group_type" property="groupType" jdbcType="INTEGER" />
|
||||
<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="service_group_id" property="serviceGroupId" jdbcType="INTEGER" />
|
||||
<result column="description" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="CommonGroupInfoColumns">
|
||||
r.group_id,r.group_name,r.group_type,r.is_valid,r.create_time,r.edit_time,
|
||||
r.creator_id,r.editor_id,r.service_group_id,r.description
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
<select id="findCommonGroupInfoList" resultMap="CommonGroupInfoMap">
|
||||
<!-- 查出所有 有效数据-->
|
||||
<select id="findCommonGroupInfoList" resultMap="CommonGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="CommonGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
@@ -30,7 +30,6 @@
|
||||
FROM policy_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}
|
||||
@@ -42,7 +41,7 @@
|
||||
AND r.group_type =#{groupType }
|
||||
</if>
|
||||
<if test="groupType == null">
|
||||
AND r.group_type NOT IN(1,2,3,4)
|
||||
AND r.group_type IN(5,7,8,9)
|
||||
</if>
|
||||
AND r.IS_VALID =1
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
@@ -62,7 +61,6 @@
|
||||
ORDER BY r.group_id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getById" resultType="com.nis.domain.basics.CommonGroupInfo">
|
||||
@@ -174,99 +172,4 @@
|
||||
r.group_id IN (${ids})
|
||||
</select>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
<!-- <select id="findPolicyGroupInfos" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1
|
||||
</select>
|
||||
<select id="findNatPolicyGroups" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 AND r.group_type = 2 OR r.group_type = 3
|
||||
</select>
|
||||
<select id="findHasIPPolicyGroupInfosByType" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM (
|
||||
SELECT DISTINCT dns_strategy_id FROM dns_ip_cfg WHERE is_valid=1 AND is_audit=1
|
||||
) a
|
||||
LEFT JOIN policy_group_info r ON a.dns_strategy_id=r.group_id
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getInfoByAsnNo" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="groupId != null" >
|
||||
AND group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnNo != null" >
|
||||
AND asn_no = #{asnNo,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
AND is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null" >
|
||||
AND is_valid != -1
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<select id="getHasAreaPolicyGroups" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
WHERE
|
||||
r.is_valid = 1 AND
|
||||
r.group_type = #{groupType,jdbcType=INTEGER} AND
|
||||
r.group_id IN (
|
||||
SELECT ga.group_id FROM group_area_info ga WHERE ga.is_valid != -1
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getGroupIdByGroupName" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
r.group_id
|
||||
FROM
|
||||
policy_group_info r
|
||||
WHERE
|
||||
r.group_name = #{groupName}
|
||||
</select>
|
||||
|
||||
<select id="getGroupInfo" resultType="com.nis.domain.basics.PolicyGroupInfo">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM
|
||||
policy_group_info r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="groupName != null and groupName != ''" >
|
||||
AND group_name = #{groupName,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="groupType != null" >
|
||||
AND group_type = #{groupType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnNo != null" >
|
||||
AND asn_no = #{asnNo,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
AND is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null" >
|
||||
AND is_valid != -1
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -178,7 +178,9 @@
|
||||
<if test="userRegion3 != null">
|
||||
AND r.user_region3 like concat(concat('%',#{userRegion3,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
@@ -309,46 +311,46 @@
|
||||
</insert>
|
||||
<insert id="insertForBatch" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
insert into ip_comm_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,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5
|
||||
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,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
@@ -502,10 +504,10 @@
|
||||
<if test="userRegion5 != null and userRegion5 != ''" >
|
||||
USER_REGION5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''" >
|
||||
<if test="groupId != null" >
|
||||
GROUP_ID = #{groupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="regionId != null and regionId != ''" >
|
||||
<if test="regionId != null" >
|
||||
REGION_ID = #{regionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
||||
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
@@ -43,7 +45,7 @@
|
||||
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.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit, r.region_id, r.group_id,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
</sql>
|
||||
|
||||
@@ -54,7 +56,7 @@
|
||||
,s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name,c.group_name
|
||||
</trim>
|
||||
FROM
|
||||
http_url_cfg r
|
||||
url_comm_cfg r
|
||||
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
|
||||
@@ -132,7 +134,9 @@
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
@@ -156,7 +160,7 @@
|
||||
,s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name
|
||||
</trim>
|
||||
FROM
|
||||
http_url_cfg r
|
||||
url_comm_cfg r
|
||||
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
|
||||
@@ -167,7 +171,7 @@
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
http_url_cfg r
|
||||
url_comm_cfg r
|
||||
where r.CFG_ID =#{cfgId}
|
||||
|
||||
</select>
|
||||
@@ -177,7 +181,7 @@
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
http_url_cfg r
|
||||
url_comm_cfg r
|
||||
WHERE
|
||||
r.cfg_id = #{ids} AND r.is_valid != -1
|
||||
</select>
|
||||
@@ -186,44 +190,46 @@
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
http_url_cfg r
|
||||
url_comm_cfg r
|
||||
WHERE
|
||||
r.user_region3 IN(${ids}) AND r.is_valid != -1
|
||||
</select>
|
||||
|
||||
<insert id="insertUrlCommGroupCfg" parameterType="com.nis.domain.basics.UrlCommCfg">
|
||||
insert into http_url_cfg (
|
||||
CFG_DESC,
|
||||
cfg_keywords,
|
||||
action,
|
||||
is_valid,
|
||||
is_audit,
|
||||
creator_id,
|
||||
create_time,
|
||||
editor_id,
|
||||
edit_time,
|
||||
auditor_id,
|
||||
audit_time,
|
||||
service_id,
|
||||
request_id,
|
||||
compile_id,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
expr_type,
|
||||
match_method,
|
||||
is_hexbin,
|
||||
area_effective_ids,
|
||||
function_id,
|
||||
cfg_region_code,
|
||||
cfg_type,
|
||||
ratelimit,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
insert into url_comm_cfg (
|
||||
CFG_DESC,
|
||||
cfg_keywords,
|
||||
action,
|
||||
is_valid,
|
||||
is_audit,
|
||||
creator_id,
|
||||
create_time,
|
||||
editor_id,
|
||||
edit_time,
|
||||
auditor_id,
|
||||
audit_time,
|
||||
service_id,
|
||||
request_id,
|
||||
compile_id,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
expr_type,
|
||||
match_method,
|
||||
is_hexbin,
|
||||
area_effective_ids,
|
||||
function_id,
|
||||
cfg_region_code,
|
||||
cfg_type,
|
||||
ratelimit,
|
||||
region_id,
|
||||
group_id,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{cfgKeywords,jdbcType=VARCHAR},
|
||||
@@ -251,6 +257,8 @@
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{ratelimit,jdbcType=VARCHAR},
|
||||
#{regionId,jdbcType=INTEGER},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
@@ -272,7 +280,7 @@
|
||||
</update>
|
||||
|
||||
<update id="update" parameterType="com.nis.domain.basics.UrlCommCfg" >
|
||||
update http_url_cfg
|
||||
update url_comm_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
@@ -347,6 +355,9 @@
|
||||
<if test="ratelimit != null and ratelimit != ''" >
|
||||
ratelimit = #{ratelimit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -370,18 +381,18 @@
|
||||
</update>
|
||||
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from http_url_cfg where cfg_id in (${ids})
|
||||
delete from url_comm_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
|
||||
<select id="getByIds" resultMap="urlCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from http_url_cfg r
|
||||
from url_comm_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
|
||||
<select id="getGroupIdCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
||||
SELECT COUNT(cfg_id) groupCount from http_url_cfg
|
||||
SELECT COUNT(cfg_id) groupCount from url_comm_cfg
|
||||
WHERE user_region3= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user