<?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.ruoyi.platform.mapper.SysDictTypeMapper">

	<resultMap type="com.ruoyi.common.core.domain.platform.vo.SysDictTypeVO" id="SysDictTypeResult">
		<id     property="id"     column="id"     />
		<result property="dictName"   column="dict_name"   />
		<result property="dictType"   column="dict_type"   />
		<result property="status"     column="status"      />
		<result property="createBy"   column="create_by"   />
		<result property="createTime" column="create_time" />
		<result property="updateBy"   column="update_by"   />
		<result property="updateTime" column="update_time" />
	</resultMap>
	
	<sql id="selectDictTypeVo">
        select id, dict_name, dict_type, status, create_by, create_time, remark
		from sys_dict_type
    </sql>

	<select id="selectDictTypeList" parameterType="com.ruoyi.common.core.domain.platform.dto.SysDictTypeDTO" resultMap="SysDictTypeResult">
	    <include refid="selectDictTypeVo"/>
		<where>
		    <if test="dictName != null and dictName != ''">
				AND dict_name like concat('%', #{dictName}, '%')
			</if>
			<if test="status != null and status != ''">
				AND status = #{status}
			</if>
			<if test="dictType != null and dictType != ''">
				AND dict_type like concat('%', #{dictType}, '%')
			</if>
			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
				and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
			</if>
			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
			</if>
	    </where>
	</select>
	
</mapper> 