IP配置导出提交

This commit is contained in:
wangxin
2018-07-03 14:55:36 +08:00
parent abe373ced3
commit c74e75f306
14 changed files with 224 additions and 31 deletions

View File

@@ -19,6 +19,7 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
public BaseIpCfg get(BaseIpCfg entity) ;
public List<BaseIpCfg> findList(BaseIpCfg entity) ;
public List<BaseIpCfg> getListByCfgId(@Param("tableName")String tableName,@Param("functionId")int functionId,@Param("ids")String ids) ;
public List<BaseIpCfg> getListByCfgIdWithName(@Param("tableName")String tableName,@Param("functionId")int functionId,@Param("ids")String ids) ;
public List<BaseIpCfg> getListByComileId(@Param("tableName")String tableName,@Param("functionId")int functionId,@Param("ids")String ids) ;
public int insert(BaseIpCfg entity) ;
public int update(BaseIpCfg entity) ;

View File

@@ -52,6 +52,13 @@
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE
</sql>
<sql id="BaseIpCfg_Column_List_with_id_name" >
CFG_ID, CFG_DESC,CFG_REGION_CODE,CFG_TYPE, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,PROTOCOL_ID,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,RATELIMIT,DNS_STRATEGY_ID,IR_TYPE
</sql>
<sql id="BaseIpCfg_Column_List_with_id_alias" >
<choose>
<when test="page !=null and page.alias != null and page.alias != ''">
@@ -580,4 +587,23 @@
<update id="deleteByCompileIds" parameterType="com.nis.domain.configuration.BaseIpCfg" >
update ${tableName} set is_valid = -1, editor_id = #{user,jdbcType=INTEGER} , edit_time = NOW() where compile_id in (${compileIds})
</update>
<select id="getListByCfgIdWithName" resultMap="BaseIpMapWithUser">
select
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
r.IP_PATTERN as ipPattern, r.SRC_IP_ADDRESS as srcIpAddress, r.DEST_IP_ADDRESS as destIpAddress, r.PORT_PATTERN as portPattern,r.SRC_PORT as srcPort,r.DEST_PORT as destPort,
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId,r.RATELIMIT AS ratelimit,
r.DNS_STRATEGY_ID AS dnsStrategyId,r.IR_TYPE AS irType
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,po.group_name as group_name
from ${tableName} 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
left join request_info ri on r.request_id=ri.id
left join policy_group_info po on r.dns_strategy_id=po.group_id
WHERE r.CFG_ID in (${ids}) AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</select>
</mapper>