All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mapper.sys.SysMenuMapper.xml Maven / Gradle / Ivy

The newest version!
<?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="io.github.wslxm.springbootplus2.manage.sys.mapper.SysMenuMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="io.github.wslxm.springbootplus2.manage.sys.model.entity.SysMenu">

        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="update_user" property="updateUser"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="deleted" property="deleted"/>
        <result column="version" property="version"/>
        <result column="pid" property="pid"/>
        <result column="name" property="name"/>
        <result column="url" property="url"/>
        <result column="icon" property="icon"/>
        <result column="sort" property="sort"/>
        <result column="root" property="root"/>
        <result column="disable" property="disable"/>
    </resultMap>

    <!-- 通用查询结果列: <include refid="Base_Column_List"></include>  -->
    <sql id="Base_Column_List">

               id,
               create_user,
               update_user,
               create_time,
               update_time,
               deleted,
               version,
               pid,
               name,
               url,
               icon,
               sort,
               root,
               disable
        </sql>


    <select id="list" resultType="io.github.wslxm.springbootplus2.manage.sys.model.vo.SysMenuVO">
        select
        m.*
        from t_sys_menu m
        <if test="loginUserId != null">
            left join t_sys_role_menu rm on rm.menu_id = m.id
            left join t_sys_role r on r.id = rm.role_id
            left join t_sys_role_user ru on ru.role_id = rm.role_id
            left join t_sys_user u on u.id = ru.user_id
        </if>
        where m.deleted = 0
        <if test="loginUserId != null">
            and rm.deleted = 0
            and ru.deleted = 0
            and r.deleted = 0
            and u.deleted = 0
            and r.`disable` = 0
            and u.`disable` = 0
            and u.id = #{loginUserId}
        </if>
        <if test="disable != null">
            and m.`disable` = #{disable}
        </if>
        group by m.id
        order by m.sort asc,m.create_time desc
    </select>

</mapper>





© 2015 - 2024 Weber Informatics LLC | Privacy Policy