<?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.SysConfigMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.system.model.SysConfig">
        <id column="id" property="id" />
        <result column="config_id" property="configId" />
        <result column="dict_key" property="dictKey" />
        <result column="dict_value" property="dictValue" />
        <result column="type" property="type" />
        <result column="comm" property="comm" />
        <result column="status" property="status" />
        <result column="valid_state" property="validState" />
        <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.SysConfigDTO">
        select id, config_id, dict_key, dict_value, `type`, comm, status, valid_state, create_time, update_time
        from sys_config
        <where>
            status = 0
            <if test="keyword != null and keyword != ''">
                and dict_key like CONCAT('%', #{keyword},'%')
                or dict_value like CONCAT('%', #{keyword},'%')
            </if>
        </where>
        order by create_time desc
    </select>
</mapper>
