<?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.doumee.dao.system.SystemDictMapper"> 
 | 
  
 | 
  <!-- 查询字典列表 --> 
 | 
  <resultMap id="SystemDictListVO" type="com.doumee.dao.system.vo.SystemDictListVO" autoMapping="true"> 
 | 
    <id column="id" property="id"/> 
 | 
    <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser"> 
 | 
      <result column="create_user_id" property="id"/> 
 | 
      <result column="create_user_name" property="username"/> 
 | 
    </association> 
 | 
    <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser"> 
 | 
      <result column="update_user_id" property="id"/> 
 | 
      <result column="update_user_name" property="username"/> 
 | 
    </association> 
 | 
  </resultMap> 
 | 
  <select id="selectManageList" parameterType="com.doumee.dao.system.dto.QuerySystemDictDTO" resultMap="SystemDictListVO"> 
 | 
    select 
 | 
      dict.id, dict.code, dict.name, dict.remark, dict.create_time, dict.update_time, dict.create_user, dict.update_user, 
 | 
      create_user.id create_user_id, create_user.username create_user_name, 
 | 
      update_user.id updete_user_id, update_user.username update_user_name 
 | 
    from system_dict dict 
 | 
    left join "system_user" create_user on create_user.id = dict.create_user 
 | 
    left join "system_user" update_user on update_user.id = dict.update_user 
 | 
    <where> 
 | 
      dict.deleted = 0 
 | 
      <if test="dto.code != null and dto.code != ''"> 
 | 
        AND dict.code LIKE '%'||#{dto.code}||'%' 
 | 
      </if> 
 | 
      <if test="dto.name != null and dto.name != ''"> 
 | 
        AND dict.name LIKE '%'||#{dto.name}||'%' 
 | 
      </if> 
 | 
    </where> 
 | 
    ${orderByClause} 
 | 
  </select> 
 | 
  
 | 
</mapper> 
 |