Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
chenjinsong
2018-03-22 14:41:33 +08:00
79 changed files with 5111 additions and 2093 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

@@ -39,6 +39,7 @@
u.name AS editorName,
r.edit_time AS editTime,
e.name AS currentName,
e.name AS auditorName,
r.audit_time AS auditTime,
t.task_name AS taskName
from request_info r
@@ -46,7 +47,7 @@
left join sys_user u on r.editor_id=u.id
left join sys_user e on r.auditor_id=e.id
left join task_info t on r.task_id=t.id
where r.is_valid=1 and r.is_audit !=3
where r.is_valid!=-1 and r.is_audit !=3
<if test="requestTitle != null and requestTitle != ''">
AND r.request_title like
<if test="dbName == 'mysql'">CONCAT('%',#{requestTitle}, '%')</if>
@@ -56,7 +57,8 @@
<if test="dbName == 'mysql'">CONCAT('%',#{requestContent},'%')</if>
</if>
<if test="requestNumber != null and requestNumber != ''">
AND r.request_number=#{requestNumber}
AND r.request_number like
<if test="dbName == 'mysql'">CONCAT('%',#{requestNumber},'%')</if>
</if>
<if test="isAudit != null">
AND r.is_audit=${isAudit}
@@ -65,9 +67,18 @@
AND r.request_time between #{beginDate} and #{endDate}
</if>
<if test="dobeginDate!=null and dobeginDate!='' and doendDate!=null and doendDate!=''">
AND (r.create_time between #{dobeginDate} and #{doendDate}) or (r.audit_time between #{dobeginDate} and #{doendDate})
</if>
order by r.request_time desc
AND r.edit_time between #{dobeginDate} and #{doendDate}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.create_time desc
</otherwise>
</choose>
</select>
<!-- 根据来函号查询 -->
<select id="getRequestInfoByRequestNumber" parameterType="java.lang.String" resultMap="BaseResultMap">
@@ -78,10 +89,31 @@
</select>
<!-- 根据来id查询 -->
<select id="getRequestInfoById" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from request_info
where id = #{id,jdbcType=BIGINT}
select
r.id AS id,
r.task_id AS taskId,
r.request_number AS requestNumber,
r.request_org AS requestOrg,
r.request_time AS requestTime,
r.request_title AS requestTitle,
r.request_content AS requestContent,
r.is_valid AS isValid,
r.is_audit AS isAudit,
s.name AS creatorName,
r.create_time AS createTime,
u.name AS editorName,
r.edit_time AS editTime,
e.name AS currentName,
e.name AS auditorName,
r.audit_time AS auditTime,
t.task_name AS taskName
from request_info r
left join sys_user s on r.creator_id=s.id
left join sys_user u on r.editor_id=u.id
left join sys_user e on r.auditor_id=e.id
left join task_info t on r.task_id=t.id
where r.is_valid!=-1 and r.is_audit !=3
and r.id = #{id,jdbcType=BIGINT}
</select>
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.configuration.RequestInfo">
@@ -98,31 +130,32 @@
editor_id,
edit_time,
auditor_id,
audit_time
audit_time,
task_id
)
values (#{requestNumber,jdbcType=VARCHAR}, #{requestOrg,jdbcType=VARCHAR},
#{requestTime,jdbcType=DATE}, #{requestTitle,jdbcType=VARCHAR}, #{requestContent,jdbcType=VARCHAR},
#{isValid,jdbcType=INTEGER}, #{isAudit,jdbcType=INTEGER}, #{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=DATE}, #{editorId,jdbcType=INTEGER}, #{editTime,jdbcType=DATE},
#{auditorId,jdbcType=INTEGER}, #{auditTime,jdbcType=DATE})
#{auditorId,jdbcType=INTEGER}, #{auditTime,jdbcType=DATE}, #{taskId,jdbcType=BIGINT})
</insert>
<!--修改 -->
<update id="update" parameterType="com.nis.domain.configuration.RequestInfo">
update request_info
<set>
<if test="requestNumber != null">
<if test="requestNumber != null and requestNumber!=''" >
request_number = #{requestNumber,jdbcType=VARCHAR},
</if>
<if test="requestOrg != null">
<if test="requestOrg != null and requestOrg!=''">
request_org = #{requestOrg,jdbcType=VARCHAR},
</if>
<if test="requestTime != null">
request_time = #{requestTime,jdbcType=DATE},
</if>
<if test="requestTitle != null">
<if test="requestTitle != null and requestTitle!=''">
request_title = #{requestTitle,jdbcType=VARCHAR},
</if>
<if test="requestContent != null">
<if test="requestContent != null and requestContent!=''">
request_content = #{requestContent,jdbcType=VARCHAR},
</if>
<if test="isValid != null">
@@ -149,6 +182,9 @@
<if test="auditTime != null">
audit_time = #{auditTime,jdbcType=DATE},
</if>
<if test="taskId != null">
task_id = #{taskId},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>

View File

@@ -20,13 +20,14 @@
id, task_name, task_org, task_time, task_desc, is_valid, is_audit, creator_id, create_time,
editor_id, edit_time, auditor_id, audit_time
</sql>
<!-- 查询有效且通过审核 -->
<select id="findList" parameterType="com.nis.domain.configuration.TaskInfo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from task_info
from task_info t
where is_valid =1 and is_audit =1
<if test="id!=null">
where id = #{id,jdbcType=BIGINT}
AND id = #{id,jdbcType=BIGINT}
</if>
</select>
@@ -36,6 +37,7 @@
r.id AS id,
r.task_name AS taskName,
r.task_org AS taskOrg,
r.task_desc AS taskDesc,
r.task_time AS taskTime,
r.is_valid AS isValid,
r.is_audit AS isAudit,
@@ -43,13 +45,13 @@
r.create_time AS createTime,
u.name AS editorName,
r.edit_time AS editTime,
e.name AS currentName,
e.name AS auditorName,
r.audit_time AS auditTime
from task_info r
left join sys_user s on r.creator_id=s.id
left join sys_user u on r.editor_id=u.id
left join sys_user e on r.auditor_id=e.id
where r.is_valid=1 and r.is_audit !=3
where r.is_valid!=-1 and r.is_audit !=3
<if test="taskName != null and taskName != ''">
AND r.task_name like
<if test="dbName == 'mysql'">CONCAT('%',#{taskName}, '%')</if>
@@ -61,9 +63,16 @@
AND r.task_time between #{beginDate} and #{endDate}
</if>
<if test="dobeginDate!=null and dobeginDate!='' and doendDate!=null and doendDate!=''">
AND (r.create_time between #{dobeginDate} and #{doendDate}) or (r.audit_time between #{dobeginDate} and #{doendDate})
AND r.edit_time between #{dobeginDate} and #{doendDate}
</if>
order by r.task_time desc
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.create_time desc
</otherwise>
</choose>
</select>
<!-- 根据来函号查询 -->
<select id="getTaskInfoByTaskName" parameterType="java.lang.String" resultMap="BaseResultMap">

View File

@@ -0,0 +1,46 @@
package com.nis.web.dao.specific;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
/**
* 根据id查出对象
* @param specServiceId
* @return
*/
SpecificServiceCfg getBySpecServiceId(Integer specServiceId);
/**
* 查询所有符合条件顶层分页列表
* @param specificServiceCfg
*/
List<SpecificServiceCfg> findTopPage(SpecificServiceCfg specificServiceCfg);
/**
* 查询所有符合条件的数据
* @param specificServiceCfg
* @return
*/
List<SpecificServiceCfg> findAllSpecificServiceCfg(@Param("specificServiceCfg")SpecificServiceCfg specificServiceCfg,@Param("orderBy")String orderBy);
/**
* 修改配置信息
* @param specificServiceCfg
* @param oldId
*/
void update(@Param("specificServiceCfg")SpecificServiceCfg specificServiceCfg, @Param("oldId")Integer oldId);
/**
* 根据specServiceId查询所有下级
* @param specServiceId
* @return
*/
List<SpecificServiceCfg> getChildrenById(Integer specServiceId);
}

View File

@@ -0,0 +1,151 @@
<?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.specific.SpecificServiceCfgDao" >
<resultMap id="CFGResultMap" type="com.nis.domain.specific.SpecificServiceCfg" >
<id column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="spec_service_name" property="specServiceName" jdbcType="VARCHAR" />
<result column="spec_service_desc" property="specServiceDesc" jdbcType="VARCHAR" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="op_time" property="opTime" jdbcType="TIMESTAMP" />
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="group_id" property="groupId" jdbcType="INTEGER" />
<!-- 父id -->
<association property="parent" javaType="com.nis.domain.specific.SpecificServiceCfg">
<id column="parent_id" property="specServiceId" jdbcType="INTEGER" />
</association>
</resultMap>
<sql id="specificServiceCfgColumns">
s.spec_service_id AS specServiceId,
s.spec_service_name AS specServiceName,
s.spec_service_desc AS specServiceDesc,
s.is_valid AS isValid,
s.op_time AS opTime,
s.parent_id AS "parent.specServiceId",
s.is_leaf AS isLeaf,
s.group_id AS groupId
</sql>
<!-- 根据id查出对象 -->
<select id="getBySpecServiceId" resultType="com.nis.domain.specific.SpecificServiceCfg" parameterType="java.lang.Integer">
select <include refid="specificServiceCfgColumns" />
from specific_service_cfg s where s.spec_service_id = #{specServiceId}
</select>
<!-- 查出所有符合条件的顶层数据 -->
<select id="findTopPage" resultMap="CFGResultMap" parameterType="com.nis.domain.specific.SpecificServiceCfg">
SELECT * FROM specific_service_cfg s WHERE s.is_valid=1
<if test="specServiceId != null">
AND s.spec_service_id like '%${specServiceId}%'
</if>
<if test="specServiceName != null and specServiceName != '' ">
AND s.spec_service_name like '%${specServiceName}%'
</if>
<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>
<if test="endDate != null" >
AND s.op_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
AND s.parent_id not in (
SELECT s2.spec_service_id FROM specific_service_cfg s2 WHERE s2.is_valid=1
<if test="specServiceId != null">
AND s2.spec_service_id like '%${specServiceId}%'
</if>
<if test="specServiceName != null and specServiceName != '' ">
AND s2.spec_service_name like '%${specServiceName}%'
</if>
<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>
<if test="endDate != null" >
AND s2.op_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
)
<choose>
<when test="page != null and page.orderBy != null and page.orderBy != ''">
ORDER BY s.${page.orderBy}
</when>
<otherwise>
ORDER BY s.op_time desc
</otherwise>
</choose>
</select>
<!-- 查询符合条件的所有数据 -->
<select id="findAllSpecificServiceCfg" resultMap="CFGResultMap" >
SELECT * from specific_service_cfg where is_valid = 1
<if test="specificServiceCfg.specServiceId != null">
AND spec_service_id like '%${specificServiceCfg.specServiceId}%'
</if>
<if test="specificServiceCfg.specServiceName != null and specificServiceCfg.specServiceName != '' ">
AND spec_service_name like '%${specificServiceCfg.specServiceName}%'
</if>
<if test="specificServiceCfg.specServiceDesc != null and specificServiceCfg.specServiceDesc != '' ">
AND spec_service_desc like '%${specificServiceCfg.specServiceDesc}%'
</if>
<if test="specificServiceCfg.groupId != null and specificServiceCfg.groupId != '' ">
AND group_id like '%${specificServiceCfg.groupId}%'
</if>
<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="orderBy != null and orderBy != '' ">
ORDER BY ${orderBy}
</when>
<otherwise>
ORDER BY op_time desc
</otherwise>
</choose>
</select>
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceCfg" useGeneratedKeys="true">
insert into specific_service_cfg (spec_service_id,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id)
values(#{specServiceId},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId})
</insert>
<!-- 修改 -->
<update id="update" parameterType="com.nis.domain.specific.SpecificServiceCfg">
UPDATE specific_service_cfg s SET
s.spec_service_id = #{specificServiceCfg.specServiceId},
s.spec_service_name = #{specificServiceCfg.specServiceName},
s.spec_service_desc = #{specificServiceCfg.specServiceDesc},
s.is_valid = #{specificServiceCfg.isValid},
s.op_time = #{specificServiceCfg.opTime},
s.parent_id = #{specificServiceCfg.parent.specServiceId},
s.is_leaf = #{specificServiceCfg.isLeaf},
s.group_id = #{specificServiceCfg.groupId}
WHERE s.spec_service_id = #{oldId}
</update>
<!-- 删除 -->
<update id="delete" parameterType="com.nis.domain.specific.SpecificServiceCfg">
UPDATE specific_service_cfg s set s.is_valid = #{isValid} where s.spec_service_id = #{specServiceId}
</update>
<!-- getChildrenById -->
<select id="getChildrenById" resultMap="CFGResultMap" parameterType="java.lang.Integer">
SELECT * FROM specific_service_cfg s WHERE s.is_valid = 1 and s.parent_id = #{specServiceId}
</select>
</mapper>

View File

@@ -0,0 +1,48 @@
package com.nis.web.dao.specific;
import java.util.List;
import com.nis.domain.specific.SpecificServiceHostCfg;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface SpecificServiceHostCfgDao extends CrudDao<SpecificServiceHostCfg> {
/**
* 根据主键查询数据对象
* @param hostId
* @return
*/
SpecificServiceHostCfg getByHostId(Integer hostId);
/**
* 查询分页
* @param specificServiceHostCfg
* @return
*/
List<SpecificServiceHostCfg> findSpecHostList(SpecificServiceHostCfg specificServiceHostCfg);
/**
* 查出所有
* @return
*/
List<SpecificServiceHostCfg> getAll();
/**
* 删除
* @param hostId
*/
void delete(Integer hostId);
/**
* 根据协议ID查询对象
* @param specServiceId
* @return
*/
SpecificServiceHostCfg getBySpecServiceId(Integer specServiceId);
}

View File

@@ -0,0 +1,174 @@
<?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.specific.SpecificServiceHostCfgDao">
<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="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" />
<result column="src_port_mask" property="srcPortMask" jdbcType="VARCHAR" />
<result column="dst_ip" property="dstIp" jdbcType="VARCHAR" />
<result column="dst_ip_mask" property="dstIpMask" jdbcType="VARCHAR" />
<result column="dst_port" property="dstPort" jdbcType="VARCHAR" />
<result column="dst_port_mask" property="dstPortMask" jdbcType="VARCHAR" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<!-- 创建人员 -->
<association property="creator" javaType="com.nis.domain.SysUser">
<id property="id" column="creator_id" />
</association>
<!-- 修改人员 -->
<association property="editor" javaType="com.nis.domain.SysUser">
<id property="id" column="editor_id" />
</association>
<!-- 审核人员 -->
<association property="auditor" javaType="com.nis.domain.SysUser">
<id property="id" column="auditor_id" />
</association>
</resultMap>
<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,
s.src_port_mask AS srcPortMask,
s.dst_ip AS dstIp,
s.dst_ip_mask AS dstIpMask,
s.dst_port AS dstPort,
s.dst_port_mask AS dstPortMask,
s.direction AS direction,
s.protocol AS protocol,
s.is_valid AS isValid,
s.is_audit AS isAudit,
s.creator_id AS "creator.id",
s.create_time AS createTime,
s.editor_id AS "editor.id",
s.edit_time AS editTime,
s.auditor_id AS "auditor.id",
s.audit_time AS auditTime
</sql>
<!-- 根据id查出对象 -->
<select id="getByHostId" resultType="com.nis.domain.specific.SpecificServiceHostCfg"
parameterType="java.lang.Integer">
select
<include refid="specificServiceHostCfgColumns" />
from specific_service_host_cfg s where s.host_id = #{hostId}
</select>
<!-- 查询分页 -->
<select id="findSpecHostList" resultMap="specificServiceHostCfgResultMap" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
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 and beginDate !='' " >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null and endDate !='' " >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null and editBeginDate !='' " >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null and editEndDate !='' " >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<if test="auditBeginDate !=null and auditBeginDate !='' " >
AND audit_time &gt;= #{auditBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="auditEndDate !=null and auditEndDate !='' " >
AND audit_time &lt;= #{auditEndDate,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="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,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},
s.src_port_mask = #{srcPortMask},
s.dst_ip = #{dstIp},
s.dst_ip_mask = #{dstIpMask},
s.dst_port = #{dstPort},
s.dst_port_mask = #{dstPortMask},
s.direction = #{direction},
s.protocol = #{protocol},
s.is_valid = #{isValid},
s.is_audit = #{isAudit},
s.creator_id = #{creator.id},
s.create_time = #{createTime},
s.editor_id = #{editor.id},
s.edit_time = #{editTime},
s.auditor_id = #{auditor.id},
s.audit_time = #{auditTime}
where s.host_id = #{hostId}
</update>
<!-- 删除 -->
<update id="delete" parameterType="java.lang.Integer">
update specific_service_host_cfg s set
s.is_valid = 0
where s.host_id = #{hostId}
</update>
</mapper>