xiangpei
2025-04-18 23da057f35cea1ee061adc23ccb9b7511635133b
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
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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.monkeylessey.sys.mapper.SysUserMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.monkeylessey.sys.domain.vo.SysUserVO">
        <result column="id" property="id" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_update" property="gmtUpdate" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="user_name" property="userName" />
        <result column="nick_name" property="nickName" />
        <result column="email" property="email" />
        <result column="phone_number" property="phoneNumber" />
        <result column="sex" property="sex" />
        <result column="password" property="password" />
        <result column="avatar" property="avatar" />
        <result column="status" property="status" />
        <result column="login_date" property="loginDate" />
        <result column="tenant_id" property="tenantId" />
    </resultMap>
 
    <select id="getMenuIdString" resultType="String">
        select
            c.menu_id
        from
            sys_user a,
            sys_user_role b,
            sys_role_menu c
        where
          a.user_name = #{userName}
          and a.status = 0
          and a.deleted = 0
          and b.user_id = a.id
          and c.role_id = b.role_id
    </select>
 
    <select id="getRoleString" resultType="String">
        select
              b.role_id
        from
            sys_user a,
            sys_user_role b
        where
          a.user_name = #{userName}
          and a.status = 0
          and a.deleted = 0
          and b.user_id = a.id
    </select>
 
</mapper>