分类性质标签、地域运营商作用域:融合自定义显示,添加排序,优化代码,
特定服务器管理:修正列表分页显示,条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验, 协议ip配置:修正条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验(ipV4\ipV6地址及掩码校验,端口校验)
This commit is contained in:
@@ -27,7 +27,7 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
|
||||
* @param specificServiceCfg
|
||||
* @return
|
||||
*/
|
||||
List<SpecificServiceCfg> findAllSpecificServiceCfg(SpecificServiceCfg specificServiceCfg);
|
||||
List<SpecificServiceCfg> findAllSpecificServiceCfg(@Param("specificServiceCfg")SpecificServiceCfg specificServiceCfg,@Param("orderBy")String orderBy);
|
||||
/**
|
||||
* 修改配置信息
|
||||
* @param specificServiceCfg
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
<if test="specServiceDesc != null and specServiceDesc != '' ">
|
||||
AND s.spec_service_desc like '%${specServiceDesc}%'
|
||||
</if>
|
||||
<if test="groupId != null and groupId != '' ">
|
||||
AND group_id like '%${groupId}%'
|
||||
</if>
|
||||
<if test="beginDate != null" >
|
||||
AND s.op_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
@@ -65,6 +68,9 @@
|
||||
<if test="specServiceDesc != null and specServiceDesc != '' ">
|
||||
AND s2.spec_service_desc like '%${specServiceDesc}%'
|
||||
</if>
|
||||
<if test="groupId != null and groupId != '' ">
|
||||
AND group_id like '%${groupId}%'
|
||||
</if>
|
||||
<if test="beginDate != null" >
|
||||
AND s2.op_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
@@ -84,26 +90,29 @@
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的所有数据 -->
|
||||
<select id="findAllSpecificServiceCfg" resultMap="CFGResultMap" parameterType="com.nis.domain.specific.SpecificServiceCfg">
|
||||
<select id="findAllSpecificServiceCfg" resultMap="CFGResultMap" >
|
||||
SELECT * from specific_service_cfg where is_valid = 1
|
||||
<if test="specServiceId != null">
|
||||
AND spec_service_id like '%${specServiceId}%'
|
||||
<if test="specificServiceCfg.specServiceId != null">
|
||||
AND spec_service_id like '%${specificServiceCfg.specServiceId}%'
|
||||
</if>
|
||||
<if test="specServiceName != null and specServiceName != '' ">
|
||||
AND spec_service_name like '%${specServiceName}%'
|
||||
<if test="specificServiceCfg.specServiceName != null and specificServiceCfg.specServiceName != '' ">
|
||||
AND spec_service_name like '%${specificServiceCfg.specServiceName}%'
|
||||
</if>
|
||||
<if test="specServiceDesc != null and specServiceDesc != '' ">
|
||||
AND spec_service_desc like '%${specServiceDesc}%'
|
||||
<if test="specificServiceCfg.specServiceDesc != null and specificServiceCfg.specServiceDesc != '' ">
|
||||
AND spec_service_desc like '%${specificServiceCfg.specServiceDesc}%'
|
||||
</if>
|
||||
<if test="beginDate != null">
|
||||
AND op_time > #{beginDate}
|
||||
<if test="specificServiceCfg.groupId != null and specificServiceCfg.groupId != '' ">
|
||||
AND group_id like '%${specificServiceCfg.groupId}%'
|
||||
</if>
|
||||
<if test="endDate != null" >
|
||||
AND op_time < #{endDate}
|
||||
<if test="specificServiceCfg.beginDate != null">
|
||||
AND op_time > #{specificServiceCfg.beginDate}
|
||||
</if>
|
||||
<if test="specificServiceCfg.endDate != null" >
|
||||
AND op_time < #{specificServiceCfg.endDate}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="page != null and page.orderBy != null and page.orderBy != '' ">
|
||||
ORDER BY ${page.orderBy}
|
||||
<when test="orderBy != null and orderBy != '' ">
|
||||
ORDER BY ${orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY op_time desc
|
||||
|
||||
@@ -35,6 +35,13 @@ public interface SpecificServiceHostCfgDao extends CrudDao<SpecificServiceHostCf
|
||||
* @param hostId
|
||||
*/
|
||||
void delete(Integer hostId);
|
||||
|
||||
/**
|
||||
* 根据协议ID查询对象
|
||||
* @param specServiceId
|
||||
* @return
|
||||
*/
|
||||
SpecificServiceHostCfg getBySpecServiceId(Integer specServiceId);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<resultMap id="specificServiceHostCfgResultMap"
|
||||
type="com.nis.domain.specific.SpecificServiceHostCfg">
|
||||
<id column="host_id" property="hostId" jdbcType="INTEGER" />
|
||||
<result column="spec_service_id" property="specServiceId"
|
||||
jdbcType="INTEGER" />
|
||||
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip" property="srcIp" jdbcType="VARCHAR" />
|
||||
<result column="src_ip_mask" property="srcIpMask" jdbcType="VARCHAR" />
|
||||
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
@@ -39,6 +39,7 @@
|
||||
<sql id="specificServiceHostCfgColumns">
|
||||
s.host_id AS hostId,
|
||||
s.spec_service_id AS specServiceId,
|
||||
s.ip_type AS ipType,
|
||||
s.src_ip AS srcIp,
|
||||
s.src_ip_mask AS srcIpMask,
|
||||
s.src_port AS srcPort,
|
||||
@@ -70,35 +71,44 @@
|
||||
|
||||
<!-- 查询分页 -->
|
||||
<select id="findSpecHostList" resultMap="specificServiceHostCfgResultMap" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
|
||||
select * from specific_service_host_cfg where 1 = 1
|
||||
select * from specific_service_host_cfg where is_valid = 1
|
||||
<if test="isAudit !=null" >
|
||||
AND is_audit = #{isAudit}
|
||||
</if>
|
||||
<if test="specServiceId !=null" >
|
||||
AND spec_service_id = #{specServiceId}
|
||||
</if>
|
||||
<if test="ipType !=null" >
|
||||
AND ip_type = #{ipType}
|
||||
</if>
|
||||
<if test="srcIp !=null and srcIp !='' " >
|
||||
AND src_ip = #{srcIp}
|
||||
</if>
|
||||
<if test="dstIp !=null and dstIp !='' " >
|
||||
AND dst_ip = #{dstIp}
|
||||
</if>
|
||||
<if test="protocol !=null" >
|
||||
AND protocol = #{protocol}
|
||||
</if>
|
||||
<if test="direction !=null" >
|
||||
AND direction = #{direction}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
<if test="beginDate !=null and beginDate !='' " >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
<if test="endDate !=null and endDate !='' " >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editBeginDate !=null" >
|
||||
<if test="editBeginDate !=null and editBeginDate !='' " >
|
||||
AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editEndDate !=null" >
|
||||
<if test="editEndDate !=null and editEndDate !='' " >
|
||||
AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditBeginDate !=null" >
|
||||
<if test="auditBeginDate !=null and auditBeginDate !='' " >
|
||||
AND audit_time >= #{auditBeginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditEndDate !=null" >
|
||||
<if test="auditEndDate !=null and auditEndDate !='' " >
|
||||
AND audit_time <= #{auditEndDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<choose>
|
||||
@@ -115,17 +125,24 @@ select * from specific_service_host_cfg where 1 = 1
|
||||
<!-- 查询所有 -->
|
||||
<select id="getAll" resultMap="specificServiceHostCfgResultMap">
|
||||
select * from specific_service_host_cfg
|
||||
</select>
|
||||
<!-- 根据协议ID查询对象 -->
|
||||
<select id="getBySpecServiceId" resultType="com.nis.domain.specific.SpecificServiceHostCfg" parameterType="java.lang.Integer">
|
||||
select
|
||||
<include refid="specificServiceHostCfgColumns" />
|
||||
from specific_service_host_cfg s where s.spec_service_id = #{specServiceId}
|
||||
</select>
|
||||
|
||||
<!-- 新增 -->
|
||||
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
|
||||
insert into specific_service_host_cfg (spec_service_id,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,editor_id,edit_time,auditor_id,audit_time)
|
||||
values(#{specServiceId},#{srcIp},#{srcIpMask},#{srcPort},#{srcPortMask},#{dstIp},#{dstIpMask},#{dstPort},#{dstPortMask},#{direction},#{protocol},#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime})
|
||||
insert into specific_service_host_cfg (spec_service_id,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,editor_id,edit_time,auditor_id,audit_time)
|
||||
values(#{specServiceId},#{ipType},#{srcIp},#{srcIpMask},#{srcPort},#{srcPortMask},#{dstIp},#{dstIpMask},#{dstPort},#{dstPortMask},#{direction},#{protocol},#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime})
|
||||
</insert>
|
||||
<!-- 修改 -->
|
||||
<update id="update" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
|
||||
update specific_service_host_cfg s set
|
||||
s.spec_service_id = #{specServiceId},
|
||||
s.ip_type = #{ipType},
|
||||
s.src_ip = #{srcIp},
|
||||
s.src_ip_mask = #{srcIpMask},
|
||||
s.src_port = #{srcPort},
|
||||
|
||||
Reference in New Issue
Block a user