<?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.fzm.mall.server.admin.system.mapper.SysSensitiveWordsMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.system.model.SysSensitiveWords">
        <id column="id" property="id" />
        <result column="sensitive_words_id" property="sensitiveWordsId" />
        <result column="sensitive_words" property="sensitiveWords" />
        <result column="comm" property="comm" />
        <result column="status" property="status" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <select id="page" resultType="com.fzm.mall.server.admin.system.entity.dto.SysSensitiveWordsDTO">
        select id, sensitive_words_id, sensitive_words, comm, status, create_time, update_time
        from sys_sensitive_words
        <where>
            status = 0
            <if test="sensitiveWords != null and sensitiveWords != ''">
                and sensitive_words like CONCAT('%', #{sensitiveWords},'%')
            </if>
        </where>
        order by create_time desc
    </select>
</mapper>
