jiangping
2023-10-16 d7fe8ae3888c8e2b1eea3c1e3769be0d42a21cc9
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
<?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="doumeemes.dao.system.SystemDictMapper">
 
  <!-- 查询字典列表 -->
  <resultMap id="SystemDictListVO" type="doumeemes.dao.system.vo.SystemDictListVO" autoMapping="true">
    <id column="ID" property="id"/>
    <association property="createUserInfo" javaType="doumeemes.dao.system.model.SystemUser">
      <result column="CREATE_USER_ID" property="id"/>
      <result column="CREATE_USER_NAME" property="username"/>
    </association>
    <association property="updateUserInfo" javaType="doumeemes.dao.system.model.SystemUser">
      <result column="UPDATE_USER_ID" property="id"/>
      <result column="UPDATE_USER_NAME" property="username"/>
    </association>
  </resultMap>
  <select id="selectManageList" parameterType="doumeemes.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 concat('%', #{dto.code}, '%')
      </if>
      <if test="dto.name != null and dto.name != ''">
        AND dict.`NAME` LIKE concat('%', #{dto.name}, '%')
      </if>
    </where>
    ${orderByClause}
  </select>
 
</mapper>