jiaosong
2023-11-09 07f27cf186204bd998f1d25ef8d4e52e5dcdd34c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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"/>
      <result column="create_real_name" property="realname"/>
    </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"/>
      <result column="update_real_name" property="realname"/>
    </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,create_user.realname create_real_name,
      update_user.id updete_user_id, update_user.username update_user_name,update_user.realname update_real_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>