<?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.mes.userinfo.mapper.SysUserMapper">
|
|
<resultMap id="baseMap" type="com.mes.userinfo.entity.vo.SysUserVO">
|
<result column="id" property="id"/>
|
<result column="user_name" property="userName"/>
|
<result column="nick_name" property="nickName"/>
|
<result column="password" property="password"/>
|
<result column="avatar" property="avatar"/>
|
<collection property="roleList" ofType="com.mes.role.SysRole">
|
<id column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="state" property="state"/>
|
<result column="role_key" property="roleKey"/>
|
<result column="state" property="state"/>
|
<result column="del_flag" property="delFlag"/>
|
<result column="width" property="remark"/>
|
</collection>
|
</resultMap>
|
|
|
<select id="userList" resultMap="baseMap">
|
SELECT t.*, t2.*
|
FROM sys_user t
|
LEFT JOIN sys_user_role t1 ON t.id = t1.user_id
|
LEFT JOIN sys_role t2 ON t1.role_id = t2.id
|
WHERE 1=1
|
<if test="key != null and key != ''">
|
and t.user_name LIKE CONCAT('%', #{key}, '%')
|
</if>
|
</select>
|
</mapper>
|