Control Policy配置增加源/目的IP、关键字检索条件.

This commit is contained in:
zhangwq
2018-11-05 12:27:35 +08:00
parent 45d85db2c9
commit 052dd5321c
8 changed files with 71 additions and 18 deletions

View File

@@ -282,9 +282,9 @@
<if test="httpReqBody!=null">
AND a.compile_id in (select f.compile_id from http_body_cfg f
<where>
and cfg_type='NTC_HTTP_REQ_BODY'
AND f.cfg_type = #{httpReqBody.cfgType}
<if test="httpReqBody.cfgKeywords != null and httpReqBody.cfgKeywords != ''">
and REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqBody.cfgKeywords,jdbcType=VARCHAR}),'%')
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqBody.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
</where>
@@ -293,9 +293,9 @@
<if test="httpResBody!=null">
AND a.compile_id in (select f.compile_id from http_body_cfg f
<where>
and cfg_type='NTC_HTTP_RES_BODY'
AND f.cfg_type = #{httpResBody.cfgType}
<if test="httpResBody.cfgKeywords != null and httpResBody.cfgKeywords != ''">
and REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResBody.cfgKeywords,jdbcType=VARCHAR}),'%')
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResBody.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
</where>
@@ -304,8 +304,9 @@
<if test="httpReqHdr!=null">
AND a.compile_id in (select f.compile_id from http_req_head_cfg f
<where>
AND f.cfg_type = #{httpReqHdr.cfgType}
<if test="httpReqHdr.cfgKeywords != null and httpReqHdr.cfgKeywords != ''">
REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
</where>
)
@@ -313,8 +314,9 @@
<if test="httpResHdr!=null">
AND a.compile_id in (select f.compile_id from http_res_head_cfg f
<where>
AND f.cfg_type = #{httpResHdr.cfgType}
<if test="httpResHdr.cfgKeywords != null and httpResHdr.cfgKeywords != ''">
REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
</where>
)

View File

@@ -100,6 +100,19 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
// 设置cfg_type,用于列表检索时区分
if(entity.getHttpReqHdr() != null){
entity.getHttpReqHdr().setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
}
if(entity.getHttpReqBody() != null){
entity.getHttpReqBody().setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
}
if(entity.getHttpResHdr() != null){
entity.getHttpResHdr().setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
}
if(entity.getHttpResBody() != null){
entity.getHttpResBody().setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
}
List<CfgIndexInfo> list = websiteCfgDao.getWebsiteList(entity);
page.setList(list);
return page;

View File

@@ -161,6 +161,19 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
// 设置cfg_type,用于列表检索时区分
if(entity.getHttpReqHdr() != null){
entity.getHttpReqHdr().setCfgType(Constants.HTTP_REQ_HEAD_REGION);
}
if(entity.getHttpReqBody() != null){
entity.getHttpReqBody().setCfgType(Constants.HTTP_REQ_BODY_REGION);
}
if(entity.getHttpResHdr() != null){
entity.getHttpResHdr().setCfgType(Constants.HTTP_RES_HEAD_REGION);
}
if(entity.getHttpResBody() != null){
entity.getHttpResBody().setCfgType(Constants.HTTP_RES_BODY_REGION);
}
List<CfgIndexInfo> list = websiteCfgDao.getWebsiteList(entity);
page.setList(list);
return page;