<?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="me.zhengjie.modules.system.mapper.DictMapper">
    <resultMap id="BaseResultMap" type="me.zhengjie.modules.system.domain.Dict">
        <id column="dict_id" property="id" jdbcType="BIGINT"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
        <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        d.dict_id, d.name, d.description, d.create_by, d.update_by, d.create_time, d.update_time
    </sql>

    <select id="findAll" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"/>
        from sys_dict d
        <where>
            <if test="criteria.blurry != null and criteria.blurry != ''">
                and (
                d.name like concat('%', #{criteria.blurry}, '%')
                or d.description like concat('%', #{criteria.blurry}, '%')
                )
            </if>
        </where>
        order by d.dict_id desc
    </select>
</mapper>