<?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.nantian.cloud.query.mapper.jljc.MultiDimensionDictMapper">
    <resultMap id="BaseResultMap" type="com.nantian.cloud.query.entity.jljc.MultiDimensionDict">
        <id column="id" property="id" />
        <result column="dict_name" property="dictName" />
        <result column="dict_code" property="dictCode" />
        <result column="dict_type" property="dictType" />
        <result column="dict_belong" property="dictBelong" />
        <result column="create_by" property="createBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="remark" property="remark"/>
        <result column="version" property="version"/>
    </resultMap>
    <sql id="tableName">
        multi_dimension_dict
    </sql>

    <sql id="baseColumn">
        id,dict_name,dict_code,remark,create_by,create_time,update_by,update_time,version,dict_type,dict_belong,del_flag
    </sql>

    <select id="getPageScope" resultType="com.nantian.cloud.query.entity.jljc.MultiDimensionDict">
        select <include refid="baseColumn"></include>
        from multi_dimension_dict
        <trim prefix="where" prefixOverrides="and">
            <if test="query.dictName != null and query.dictName != ''">
                and dict_name like concat("%",#{query.dictName},"%")
            </if>
            <if test="query.dictCode != null and query.dictCode != ''">
                and dict_code =  #{query.dictCode}
            </if>
            <if test="query.dictType != null and query.dictType != ''">
                and dict_type =  #{query.dicType}
            </if>
        </trim>
        order by update_time desc
    </select>

    <select id="getList" resultType="com.nantian.cloud.query.entity.jljc.MultiDimensionDict">
        select <include refid="baseColumn"></include>
        from multi_dimension_dict
        <trim prefix="where" prefixOverrides="and">
            <if test="query.dictName != null and query.dictName != ''">
                and dict_name like concat("%",#{query.dictName},"%")
            </if>
            <if test="query.dictCode != null and query.dictCode != ''">
                and dict_code =  #{query.dictCode}
            </if>
            <if test="query.dictType != null and query.dictType != ''">
                and dict_type =  #{query.dict_type}
            </if>
        </trim>
        order by update_time desc
    </select>

</mapper>
