分类性质标签、地域运营商作用域:融合自定义显示,添加排序,优化代码,

特定服务器管理:修正列表分页显示,条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验,
协议ip配置:修正条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验(ipV4\ipV6地址及掩码校验,端口校验)
This commit is contained in:
zhangshilin
2018-03-21 13:43:43 +08:00
parent d5d708a492
commit f92ae2dda4
28 changed files with 710 additions and 1000 deletions

View File

@@ -13,17 +13,32 @@ import com.nis.web.dao.MyBatisDao;
public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
/**
* 查询顶层字典列表(无条件查询(==)
* 查询顶层字典列表(==
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findTopDictList(ServiceDictInfo serviceDictInfo);
/**
* 查询顶层字典列表(无条件查询(!=)
* 查询顶层字典列表(!=
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findTopDictListN(ServiceDictInfo serviceDictInfo);
/**
* findAllServiceDictInfo
*/
/**
* 查询所有字典列表(==
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findAllServiceDictInfo(@Param("serviceDictInfo")ServiceDictInfo serviceDictInfo,@Param("orderBy")String orderBy);
/**
* 查询所有字典列表(!=
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findAllServiceDictInfoN(@Param("serviceDictInfo")ServiceDictInfo serviceDictInfo,@Param("orderBy")String orderBy);
/**
* 查出所有有效数据
*/
@@ -38,32 +53,6 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
* @return
*/
List<ServiceDictInfo> getDictByParentId(Integer parentId);
/**
* 查询条件查询顶层字典列表(含条件查询(==)
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findDictTopSearchList(ServiceDictInfo serviceDictInfo);
/**
* 查询条件查询顶层字典列表(含条件查询(!=)
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findDictTopSearchListN(ServiceDictInfo serviceDictInfo);
/**
* 查询条件查询所有字典列表(含条件查询(==)
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findAllDictSearchList(ServiceDictInfo serviceDictInfo);
/**
* 查询条件查询所有字典列表(含条件查询(!=)
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findAllDictSearchListN(ServiceDictInfo serviceDictInfo);
/**
* 添加字典信息
* @param serviceDictInfo

View File

@@ -68,102 +68,7 @@
<!-- 查询顶层分页列表 (==)-->
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
<if test="itemValue != null and itemValue != '' " >
AND item_value like '%${itemValue}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
</if>
<if test="itemType != null and itemType != '' " >
AND item_type = #{itemType}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 查询顶层分页列表 (!=)-->
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
<if test="itemValue != null and itemValue != '' " >
AND item_value like '%${itemValue}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
</if>
<if test="itemType != null and itemType != '' " >
AND item_type != #{itemType}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 查出所有 -->
<select id="findAllDictList" resultType="serviceDictInfo">
SELECT
<include refid="serviceDictInfoColumns"/>
FROM service_dict_info s
<include refid="menuJoins"/>
WHERE s.is_valid =1 AND s.parent_id != 0
</select>
<!-- 查询所有非叶子配置 -->
<select id="findAllNoLeafDictList" resultType="com.nis.domain.basics.ServiceDictInfo" parameterType="java.lang.Integer">
SELECT
<include refid="serviceDictInfoColumns"/>
FROM service_dict_info s
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
ORDER BY s.create_time desc
</select>
<!-- 条件查询顶层分页(==) -->
<select id="findDictTopSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info s WHERE s.is_valid=1
<if test="itemCode != null and itemCode != '' " >
@@ -204,12 +109,12 @@
<if test="endDate !=null" >
AND s2.create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -222,8 +127,8 @@
</select>
<!-- 条件查询顶层分页(!=) -->
<select id="findDictTopSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
<!-- 查询顶层分页列表 (!=)-->
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info s WHERE s.is_valid=1
<if test="itemCode != null and itemCode != '' " >
@@ -265,11 +170,11 @@
AND s2.create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -281,62 +186,98 @@
</choose>
</select>
<!-- 条件查询所有列表 (==)-->
<select id="findAllDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
<!-- 查询所有列表 (==)-->
<select id="findAllServiceDictInfo" resultMap="dictResultMap">
SELECT * FROM service_dict_info WHERE is_valid=1
<if test="itemValue != null and itemValue != '' " >
AND item_value like '%${itemValue}%'
<if test="serviceDictInfo.itemValue != null and serviceDictInfo.itemValue != '' " >
AND item_value like '%${serviceDictInfo.itemValue}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
<if test="serviceDictInfo.itemCode != null and serviceDictInfo.itemCode != '' " >
AND item_code like '%${serviceDictInfo.itemCode}%'
</if>
<if test="itemType != null and itemType != '' " >
AND item_type = #{itemType}
<if test="serviceDictInfo.itemType != null and serviceDictInfo.itemType != '' " >
AND item_type = #{serviceDictInfo.itemType}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.beginDate !=null" >
AND create_time &gt;= #{serviceDictInfo.beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.endDate !=null" >
AND create_time &lt;= #{serviceDictInfo.endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.editBeginDate !=null" >
AND edit_time &gt;= #{serviceDictInfo.editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.editEndDate !=null" >
AND edit_time &lt;= #{serviceDictInfo.editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="orderBy != null and orderBy != ''">
ORDER BY ${orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 条件查询所有列表 (!=)-->
<select id="findAllDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
<!-- 查询所有列表 (!=)-->
<select id="findAllServiceDictInfoN" resultMap="dictResultMap">
SELECT * FROM service_dict_info WHERE is_valid=1
<if test="itemValue != null and itemValue != '' " >
AND item_value like '%${itemValue}%'
<if test="serviceDictInfo.itemValue != null and serviceDictInfo.itemValue != '' " >
AND item_value like '%${serviceDictInfo.itemValue}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
<if test="serviceDictInfo.itemCode != null and serviceDictInfo.itemCode != '' " >
AND item_code like '%${serviceDictInfo.itemCode}%'
</if>
<if test="itemType != null and itemType != '' " >
AND item_type != #{itemType}
<if test="serviceDictInfo.itemType != null and serviceDictInfo.itemType != '' " >
AND item_type != #{serviceDictInfo.itemType}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.beginDate !=null" >
AND create_time &gt;= #{serviceDictInfo.beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.endDate !=null" >
AND create_time &lt;= #{serviceDictInfo.endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.editBeginDate !=null" >
AND edit_time &gt;= #{serviceDictInfo.editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
<if test="serviceDictInfo.editEndDate !=null" >
AND edit_time &lt;= #{serviceDictInfo.editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="orderBy != null and orderBy != ''">
ORDER BY ${orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 查出所有 -->
<select id="findAllDictList" resultType="serviceDictInfo">
SELECT
<include refid="serviceDictInfoColumns"/>
FROM service_dict_info s
<include refid="menuJoins"/>
WHERE s.is_valid =1 AND s.parent_id != 0
</select>
<!-- 查询所有非叶子配置 -->
<select id="findAllNoLeafDictList" resultType="com.nis.domain.basics.ServiceDictInfo" parameterType="java.lang.Integer">
SELECT
<include refid="serviceDictInfoColumns"/>
FROM service_dict_info s
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
ORDER BY s.create_time desc
</select>

View File

@@ -2,6 +2,8 @@ package com.nis.web.dao.basics;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.basics.SysDictInfo;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@@ -12,48 +14,35 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
/**
* 查询顶层字典列表(无条件查询(==)
* 查询顶层字典列表(==)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findTopDictList(SysDictInfo sysDictInfo);
/**
* 查询顶层字典列表(无条件查询(!=)
* 查询顶层字典列表(!=
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findTopDictListN(SysDictInfo sysDictInfo);
/**
* 查询所有字典列表(含条件查询(==)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findAllSysDictInfo(@Param("sysDictInfo")SysDictInfo sysDictInfo,@Param("orderBy")String orderBy);
/**
* 查询所有字典列表(含条件查询(!=)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findAllSysDictInfoN(@Param("sysDictInfo")SysDictInfo sysDictInfo,@Param("orderBy")String orderBy);
/**
* 查出所有有效数据
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findAllDictList(SysDictInfo sysDictInfo);
/**
* 查询条件查询顶层字典列表(含条件查询(==)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findDictTopSearchList(SysDictInfo sysDictInfo);
/**
* 查询条件查询顶层字典列表(含条件查询(!=)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findDictTopSearchListN(SysDictInfo sysDictInfo);
/**
* 查询字典列表(含条件查询(==)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findAllDictSearchList(SysDictInfo sysDictInfo);
/**
* 查询字典列表(含条件查询(!=)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findAllDictSearchListN(SysDictInfo sysDictInfo);
/**
* 添加字典信息
* @param sysDictInfo
@@ -66,8 +55,6 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
* @return
*/
SysDictInfo getDictById(Integer sysDictId);
/**
* 查询所有的非叶子配置
* @param itemType

View File

@@ -50,79 +50,6 @@
LEFT JOIN sys_dict_info p ON p.sys_dict_id = s.parent_id
</sql>
<!-- 查询顶层分页列表 (==)-->
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
SELECT * FROM sys_dict_info WHERE is_valid=1 AND parent_id = 0
<if test="itemValue != null and itemValue != '' " >
AND item_value like '%${itemValue}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
</if>
<if test="itemType != null and itemType != '' " >
AND item_type = #{itemType}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 查询顶层分页列表 (!=)-->
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
SELECT * FROM sys_dict_info WHERE is_valid=1 AND parent_id = 0
<if test="itemValue != null and itemValue != '' " >
AND item_value like '%${itemValue}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
</if>
<if test="itemType != null and itemType != '' " >
AND item_type != #{itemType}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 查出所有 -->
<select id="findAllDictList" resultType="sysDictInfo">
SELECT
@@ -132,8 +59,8 @@
WHERE s.is_valid =1
</select>
<!-- 条件查询顶层分页(==) -->
<select id="findDictTopSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
<!-- 查询顶层分页(==) -->
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
SELECT * FROM sys_dict_info s WHERE s.is_valid=1
<if test="itemCode != null and itemCode != '' " >
@@ -192,8 +119,8 @@
</select>
<!-- 条件查询顶层分页(!=) -->
<select id="findDictTopSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
<!-- 查询顶层分页(!=) -->
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
SELECT * FROM sys_dict_info s WHERE s.is_valid=1
<if test="itemCode != null and itemCode != '' " >
@@ -252,57 +179,73 @@
</select>
<!-- 条件查询所有(==) -->
<select id="findAllDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
<!-- 查询所有(==) -->
<select id="findAllSysDictInfo" resultMap="dictResultMap">
SELECT * FROM sys_dict_info WHERE is_valid=1
<if test="itemType != null and itemType != '' " >
AND item_type = ${itemType}
<if test="sysDictInfo.itemType != null and sysDictInfo.itemType != '' " >
AND item_type = ${sysDictInfo.itemType}
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
<if test="sysDictInfo.itemCode != null and sysDictInfo.itemCode != '' " >
AND item_code like '%${sysDictInfo.itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND item_value like '%${itemValue}%'
<if test="sysDictInfo.itemValue!= null and sysDictInfo.itemValue != '' " >
AND item_value like '%${sysDictInfo.itemValue}%'
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.beginDate !=null" >
AND create_time &gt;= #{sysDictInfo.beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.endDate !=null" >
AND create_time &lt;= #{sysDictInfo.endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.editBeginDate !=null" >
AND edit_time &gt;= #{sysDictInfo.editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.editEndDate !=null" >
AND edit_time &lt;= #{sysDictInfo.editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="orderBy != null and orderBy != ''">
ORDER BY ${orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 条件查询所有(!=) -->
<select id="findAllDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
<!-- 查询所有(!=) -->
<select id="findAllSysDictInfoN" resultMap="dictResultMap">
SELECT * FROM sys_dict_info WHERE is_valid=1
<if test="itemType != null and itemType != '' " >
AND item_type = ${itemType}
<if test="sysDictInfo.itemType != null and sysDictInfo.itemType != '' " >
AND item_type = ${sysDictInfo.itemType}
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
<if test="sysDictInfo.itemCode != null and sysDictInfo.itemCode != '' " >
AND item_code like '%${sysDictInfo.itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND item_value like '%${itemValue}%'
<if test="sysDictInfo.itemValue!= null and sysDictInfo.itemValue != '' " >
AND item_value like '%${sysDictInfo.itemValue}%'
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.beginDate !=null" >
AND create_time &gt;= #{sysDictInfo.beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.endDate !=null" >
AND create_time &lt;= #{sysDictInfo.endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.editBeginDate !=null" >
AND edit_time &gt;= #{sysDictInfo.editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
<if test="sysDictInfo.editEndDate !=null" >
AND edit_time &lt;= #{sysDictInfo.editEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="orderBy != null and orderBy != ''">
ORDER BY ${orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 根据主键查询字典详细信息 -->

View File

@@ -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

View File

@@ -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 &gt;= #{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 &gt;= #{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 &gt; #{beginDate}
<if test="specificServiceCfg.groupId != null and specificServiceCfg.groupId != '' ">
AND group_id like '%${specificServiceCfg.groupId}%'
</if>
<if test="endDate != null" >
AND op_time &lt; #{endDate}
<if test="specificServiceCfg.beginDate != null">
AND op_time &gt; #{specificServiceCfg.beginDate}
</if>
<if test="specificServiceCfg.endDate != null" >
AND op_time &lt; #{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

View File

@@ -35,6 +35,13 @@ public interface SpecificServiceHostCfgDao extends CrudDao<SpecificServiceHostCf
* @param hostId
*/
void delete(Integer hostId);
/**
* 根据协议ID查询对象
* @param specServiceId
* @return
*/
SpecificServiceHostCfg getBySpecServiceId(Integer specServiceId);

View File

@@ -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 &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
<if test="endDate !=null and endDate !='' " >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
<if test="editBeginDate !=null and editBeginDate !='' " >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
<if test="editEndDate !=null and editEndDate !='' " >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<if test="auditBeginDate !=null" >
<if test="auditBeginDate !=null and auditBeginDate !='' " >
AND audit_time &gt;= #{auditBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="auditEndDate !=null" >
<if test="auditEndDate !=null and auditEndDate !='' " >
AND audit_time &lt;= #{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},