策略分组功能

dns响应策略功能
dns欺骗ip列表功能
This commit is contained in:
duandongmei
2018-06-22 10:12:54 +08:00
parent adb9d8a665
commit 7f4342f506
19 changed files with 2571 additions and 1126 deletions

View File

@@ -10,6 +10,7 @@ import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
List<PolicyGroupInfo> findPolicyGroupInfoList(PolicyGroupInfo policyGroupInfo);
List<PolicyGroupInfo> findPolicyGroupInfos();
PolicyGroupInfo getById(int id);
}

View File

@@ -59,6 +59,13 @@
</choose>
</select>
<!-- 查出所有 有效数据-->
<select id="findPolicyGroupInfos" resultMap="PolicyGroupInfoMap">
SELECT
<include refid="PolicyGroupInfoColumns"/>
FROM policy_group_info r
where r.is_valid=1
</select>
<insert id="insert" parameterType="com.nis.domain.basics.PolicyGroupInfo" >
insert into policy_group_info(
IS_VALID,

View File

@@ -1,5 +1,7 @@
package com.nis.web.dao.configuration;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.configuration.DnsIpCfg;
@@ -8,5 +10,6 @@ import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface DnsIpCfgDao extends CrudDao<DnsIpCfg> {
public int deleteByFakeId(@Param("fakeId") String fakeIds);
List<DnsIpCfg> findPage(DnsIpCfg dnsIpCfg);
DnsIpCfg getDnsIpCfg(Long cfgId);
}

View File

@@ -2,151 +2,346 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.DnsIpCfgDao">
<resultMap id="dnsIpCfgMap" type="com.nis.domain.configuration.DnsIpCfg">
<id column="cfg_id" property="cfgId"/>
<result column="cfg_desc" property="cfgDesc"/>
<result column="ip_type" property="ipType"/>
<result column="src_ip" property="srcIp"/>
<result column="src_ip_mask" property="srcIpMask"/>
<result column="src_port" property="srcPort"/>
<result column="src_port_mask" property="srcPortMask"/>
<result column="dst_ip" property="dstIp"/>
<result column="dst_ip_mask" property="dstIpMask"/>
<result column="dst_port" property="dstPort"/>
<result column="dst_port_mask" property="dstPortMask"/>
<result column="direction" property="direction"/>
<result column="protocol" property="protocol"/>
<result column="is_valid" property="isValid"/>
<result column="is_audit" property="isAudit"/>
<result column="creator_id" property="creator.id"/>
<result column="create_time" property="createTime"/>
<result column="editor_id" property="editor.id"/>
<result column="edit_time" property="editTime"/>
<result column="auditor_id" property="auditor.id"/>
<result column="audit_time" property="auditTime"/>
<result column="request_id" property="request.id"/>
<result column="fake_id" property="fakeId"/>
<result column="classify" property="classify"/>
<result column="attribute" property="attribute"/>
<result column="label" property="label"/>
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="dns_strategy_id" property="dnsStrategyId" jdbcType="VARCHAR" />
<result column="dns_strategy_name" property="dnsStrategyName" jdbcType="VARCHAR" />
</resultMap>
<sql id="columns">
dic.CFG_ID, dic.CFG_DESC, dic.IP_TYPE, dic.SRC_IP, dic.SRC_IP_MASK, dic.SRC_PORT,
dic.SRC_PORT_MASK, dic.DST_IP, dic.DST_IP_MASK, dic.DST_PORT, dic.DST_PORT_MASK,
dic.DIRECTION, dic.PROTOCOL, dic.IS_VALID, dic.IS_AUDIT, dic.CREATOR_ID,
dic.CREATE_TIME, dic.EDITOR_ID, dic.EDIT_TIME, dic.AUDITOR_ID, dic.AUDIT_TIME,
dic.REQUEST_ID, dic.FAKE_ID, dic.CLASSIFY, dic.ATTRIBUTE, dic.LABLE
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
,r.is_valid,r.is_audit,r.creator_id,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.area_effective_ids,r.function_id,r.cfg_region_code,r.dns_strategy_id
</sql>
<select id="findList" resultMap="dnsIpCfgMap">
<select id="findPage" resultMap="dnsIpCfgMap">
select
<include refid="columns"></include>,
c.name as "creator.name",
e.name as "editor.name",
a.name as "auditor.name",
ri.request_title as "request.requestTitle"
from dns_ip_cfg dic
left join sys_user c on dic.creator_id=c.id
left join sys_user e on dic.creator_id=e.id
left join sys_user a on dic.creator_id=a.id
left join request_info ri on dic.request_id=ri.id
where dic.is_valid=1
<if test="searchCreateTimeStart != null">
and dic.create_time &gt;= #{searchCreateTimeStart}
</if>
<if test="searchCreateTimeEnd != null">
and dic.create_time &lt;= #{searchCreateTimeEnd}
</if>
<!-- <if test="searchEditTimeStart != null">
and dic.create_time &gt;= #{searchEditTimeStart}
</if>
<if test="searchEditTimeEnd != null">
and dic.create_time &lt;= #{searchEditTimeEnd}
</if>
<if test="searchAuditTimeStart != null">
and dic.create_time &gt;= #{searchAuditTimeStart}
</if>
<if test="searchAuditTimeEnd != null">
and dic.create_time &lt;= #{searchAuditTimeEnd}
</if>
<if test="isAudit != null">
and dic.is_audit = #{isAudit}
</if> -->
<if test="request != null and request.id != null">
and dic.request_id = #{request.id}
</if>
<if test="classify != null and classify != ''">
and concat(",", dic.classify, ",") like concat("%,", #{classify}, ",%")
</if>
<if test="attribute != null and attribute != ''">
and concat(",", dic.attribute, ",") like concat("%,", #{attribute}, ",%")
</if>
<if test="lable != null and lable != ''">
and concat(",", dic.lable, ",") like concat("%,", #{lable}, ",%")
</if>
<if test="cfgDesc != null and cfgDesc != ''">
and dic.cfg_desc like concat("%", #{cfgDesc}, "%")
</if>
<include refid="columns"></include>
<trim prefix="," prefixOverrides=",">
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,dns.cfg_Desc as dns_strategy_name
</trim>
from dns_ip_cfg r
left join dns_res_strategy dns on dns.cfg_Id=r.dns_strategy_id
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 request_info ri on r.request_id=ri.id
<where>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="dnsStrategyName != null and dnsStrategyName != ''">
AND dns.cfg_desc like concat(concat('%',#{dnsStrategyName,jdbcType=VARCHAR}),'%')
</if>
<if test="cfgRegionCode != null">
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
</if>
<if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
<if test="ipPattern != null">
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
</if>
<if test="destIpAddress != null and destIpAddress != ''">
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
</if>
<if test="portPattern != null">
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
</if>
<if test="srcPort != null and srcPort !=''">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test="destPort != null and destPort !=''">
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
</if>
<if test="direction != null">
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
</if>
<if test="protocol != null">
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
</if>
<if test="protocolId != null">
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName !=''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime !=''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName !=''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime !='' ">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName !=''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime !=''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify !=''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute !=''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable !=''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<if test="functionId != null">
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
</where>
</select>
<select id="get" resultMap="dnsIpCfgMap">
<select id="getDnsIpCfg" resultMap="dnsIpCfgMap">
select
<include refid="columns"></include>,
c.name as "creator.name",
e.name as "editor.name",
a.name as "auditor.name",
ri.request_title as "request.requestTitle"
from dns_ip_cfg dic
left join sys_user c on dic.creator_id=c.id
left join sys_user e on dic.creator_id=e.id
left join sys_user a on dic.creator_id=a.id
left join request_info ri on dic.request_id=ri.id
where dic.cfg_id=#{id}
where dic.cfg_id=#{cfgId}
</select>
<insert id="insert">
insert into dns_ip_cfg (
cfg_desc, ip_type, src_ip, src_ip_mask, src_port,
src_port_mask, dst_ip, dst_ip_mask, dst_port, dst_port_mask,
direction, protocol, is_valid, is_audit, creator_id,
create_time, request_id, fake_id, classify, attribute, lable
) values (
#{cfgDesc}, #{ipType}, #{srcIp}, #{srcIpMask}, #{srcPort}, #{srcPortMask},
#{dstIp}, #{dstIpMask}, #{dstPort}, #{dstPortMask}, #{direction}, #{protocol},
#{isValid}, #{isAudit}, #{creator.id}, #{createTime}, #{request.id}, #{fakeId},
#{classify}, #{attribute}, #{lable}
)
<selectKey keyProperty="cfgId" resultType="java.lang.Long">
select LAST_INSERT_ID() as cfg_id
</selectKey>
</insert>
<insert id="insert" parameterType="com.nis.domain.configuration.DnsIpCfg" >
insert into dns_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,
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,
dns_strategy_id
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{protocolId,jdbcType=INTEGER},
#{direction,jdbcType=INTEGER},
#{destPort,jdbcType=VARCHAR},
#{destIpAddress,jdbcType=VARCHAR},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER},
#{dnsStrategyId,jdbcType=INTEGER}
)
</insert>
<update id="update">
update
dns_ip_cfg
set
cfg_desc=#{cfgDesc}, ip_type=#{ipType}, src_ip=#{srcIp}, src_ip_mask=#{srcIpMask},
src_port=#{srcPort}, src_port_mask=#{srcPortMask}, dst_ip=#{dstIp},
dst_ip_mask=#{dstIpMask}, dst_port=#{dstPort}, dst_port_mask=#{dstPortMask},
direction=#{direction}, protocol=#{protocol}, request_id=#{request.id},
fake_id=#{fakeId}, classify=#{classify}, attribute=#{attribute}, lable=#{lable},
editor_id=#{editor.id}, edit_time=#{editTime}
where cfg_id=#{cfgId}
</update>
<update id="delete">
update
dns_ip_cfg
set
is_valid=0
where cfg_id=#{cfgId}
</update>
<update id="deleteByFakeId">
update
dns_ip_cfg
set
is_valid=0
where fake_id =#{fakeId}
</update>
<update id="update" parameterType="com.nis.domain.configuration.DnsIpCfg" >
update dns_ip_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,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>
<if test="auditorId != null" >
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="compileId != null" >
COMPILE_ID = #{compileId,jdbcType=TIMESTAMP},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="ipType != null" >
ip_type = #{ipType,jdbcType=INTEGER},
</if>
<if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
<if test="ipPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER},
</if>
<if test="portPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER},
</if>
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null" >
protocol = #{protocol,jdbcType=INTEGER},
</if>
<if test="protocolId != null" >
protocol_id = #{protocolId,jdbcType=INTEGER},
</if>
<if test="direction != null" >
direction = #{direction,jdbcType=INTEGER},
</if>
<if test="destPort != null and destPort != ''" >
dest_port = #{destPort,jdbcType=VARCHAR},
</if>
<if test="destIpAddress != null and destIpAddress != ''" >
dest_ip_address = #{destIpAddress,jdbcType=VARCHAR},
</if>
<if test="cfgType != null and cfgType != ''" >
cfg_type = #{cfgType,jdbcType=VARCHAR},
</if>
<if test="cfgRegionCode != null " >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="dnsStrategyId != null " >
dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER},
</if>
</trim>
</set>
<where>
and cfg_id = #{cfgId,jdbcType=INTEGER}
</where>
</update>
</mapper>

View File

@@ -0,0 +1,16 @@
package com.nis.web.dao.configuration;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.configuration.DnsResStrategy;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface DnsResStrategyDao extends CrudDao<DnsResStrategy> {
List<DnsResStrategy> findPage(DnsResStrategy dnsResStrategy);
List<DnsResStrategy> findList(@Param("cfgId")Long cfgId,@Param("isValid")Integer isValid);
}

View File

@@ -0,0 +1,333 @@
<?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.configuration.DnsResStrategyDao" >
<resultMap id="DnsResStrategyMap" type="com.nis.domain.configuration.DnsResStrategy" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="res_group_1_id" property="resGroup1Id" jdbcType="INTEGER" />
<result column="res_group_1_num" property="resGroup1Num" jdbcType="INTEGER" />
<result column="res_group_2_id" property="resGroup2Id" jdbcType="INTEGER" />
<result column="res_group_2_num" property="resGroup2Num" jdbcType="INTEGER" />
<result column="res_group_3_id" property="resGroup3Id" jdbcType="INTEGER" />
<result column="res_group_3_num" property="resGroup3Num" jdbcType="INTEGER" />
<result column="res_group_4_id" property="resGroup4Id" jdbcType="INTEGER" />
<result column="res_group_4_num" property="resGroup4Num" jdbcType="INTEGER" />
<result column="res_group_5_id" property="resGroup5Id" jdbcType="INTEGER" />
<result column="res_group_5_num" property="resGroup5Num" jdbcType="INTEGER" />
<result column="min_ttl" property="minTtl" jdbcType="INTEGER" />
<result column="max_ttl" property="maxTtl" jdbcType="INTEGER" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="group_1_name" property="group1Name" jdbcType="VARCHAR" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
</resultMap>
<sql id="DnsResStrategyColumns">
r.cfg_id,r.cfg_desc,r.res_group_1_id,
r.res_group_1_num,r.res_group_2_id,r.res_group_2_num,r.res_group_3_id
,r.res_group_3_num,r.res_group_4_id,r.res_group_4_num
,r.res_group_5_id,r.res_group_5_num,r.min_ttl
,r.max_ttl,r.cfg_type,r.action
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id
,r.is_area_effective,r.classify,r.attribute,r.lable
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.compile_id
</sql>
<!-- 查出所有 有效数据-->
<select id="findPage" resultMap="DnsResStrategyMap">
SELECT
<include refid="DnsResStrategyColumns"/>
<trim prefix="," prefixOverrides=",">
, a.group_name group_1_name,s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
FROM dns_res_strategy r
left join policy_group_info a on r.res_group_1_id=a.group_Id
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 request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="group1Name != null and group1Name != ''">
AND a.group_name like concat(concat('%',#{group1Name,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</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="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.CFG_ID desc
</otherwise>
</choose>
</select>
<!-- 查出所有 有效数据-->
<select id="findList" resultMap="DnsResStrategyMap">
SELECT
<include refid="DnsResStrategyColumns"/>
FROM dns_res_strategy r
<where>
<if test="isValid == -1">
AND r.is_valid !=-1
</if>
<if test="isValid == 1">
AND r.is_valid ==1
</if>
<if test="isValid == 0">
AND r.is_valid ==0
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
</where>
</select>
<insert id="insert" parameterType="com.nis.domain.configuration.DnsResStrategy" >
insert into dns_res_strategy (
CFG_ID,
CFG_DESC,
ACTION,
IS_VALID,
IS_AUDIT,
CREATOR_ID,
CREATE_TIME,
EDITOR_ID,
EDIT_TIME,
AUDITOR_ID,
AUDIT_TIME,
SERVICE_ID,
REQUEST_ID,
IS_AREA_EFFECTIVE,
CLASSIFY,
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id,
res_group_1_id,
res_group_1_num,
res_group_2_id,
res_group_2_num,
res_group_3_id,
res_group_3_num,
res_group_4_id,
res_group_4_num,
res_group_5_id,
res_group_5_num,
min_ttl,
max_ttl,
cfg_type,
compile_Id,
cfg_region_code
)values (
#{cfgId,jdbcType=VARCHAR},
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{resGroup1Id,jdbcType=INTEGER},
#{resGroup1Num,jdbcType=INTEGER},
#{resGroup2Id,jdbcType=INTEGER},
#{resGroup2Num,jdbcType=INTEGER},
#{resGroup3Id,jdbcType=INTEGER},
#{resGroup3Num,jdbcType=INTEGER},
#{resGroup4Id,jdbcType=INTEGER},
#{resGroup4Num,jdbcType=INTEGER},
#{resGroup5Id,jdbcType=INTEGER},
#{resGroup5Num,jdbcType=INTEGER},
#{minTtl,jdbcType=INTEGER},
#{maxTtl,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},
#{compileId,jdbcType=INTEGER},
#{cfgRegionCode,jdbcType=INTEGER}
)
</insert>
<update id="update" parameterType="com.nis.domain.configuration.DnsResStrategy" >
update dns_res_strategy
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="compileId != null " >
compile_Id = #{compileId,jdbcType=VARCHAR},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,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>
<if test="auditorId != null" >
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="resGroup1Id != null" >
res_group_1_id = #{resGroup1Id,jdbcType=INTEGER},
</if>
<if test="resGroup1Num != null" >
res_group_1_num = #{resGroup1Num,jdbcType=INTEGER},
</if>
<if test="resGroup2Id != null" >
res_group_2_id = #{resGroup2Id,jdbcType=INTEGER},
</if>
<if test="resGroup2Num != null" >
res_group_2_num = #{resGroup2Num,jdbcType=INTEGER},
</if>
<if test="resGroup3Id != null" >
res_group_3_id = #{resGroup3Id,jdbcType=INTEGER},
</if>
<if test="resGroup3Num != null" >
res_group_3_num = #{resGroup3Num,jdbcType=INTEGER},
</if>
<if test="resGroup4Id != null" >
res_group_4_id = #{resGroup4Id,jdbcType=INTEGER},
</if>
<if test="resGroup4Num != null" >
res_group_4_num = #{resGroup4Num,jdbcType=INTEGER},
</if>
<if test="resGroup5Id != null" >
res_group_5_id = #{resGroup5Id,jdbcType=INTEGER},
</if>
<if test="resGroup5Num != null" >
res_group_5_num = #{resGroup5Num,jdbcType=INTEGER},
</if>
<if test="minTtl != null" >
min_ttl = #{minTtl,jdbcType=INTEGER},
</if>
<if test="maxTtl != null" >
max_ttl = #{maxTtl,jdbcType=INTEGER},
</if>
</trim>
</set>
<where>
and cfg_id = #{cfgId,jdbcType=INTEGER}
<if test="functionId != null" >
and function_id = #{functionId,jdbcType=INTEGER}
</if>
</where>
</update>
</mapper>