AdministerPermissionMapper.xml 1.49 KB
<?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.meishu.mapper.AdministerPermissionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.meishu.model.AdministerPermissionDO">
        <id column="id" property="id"/>
        <result column="create_date" property="createTime"/>
        <result column="update_date" property="updateTime"/>
        <result column="delete_date" property="deleteTime"/>
        <result column="administer_id" property="administerId"/>
        <result column="permission_id" property="permissionId"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        create_date,
        update_date,
        delete_date,
        id, administer_id, permission_id
    </sql>

    <select id="getPermissions" resultType="com.meishu.vo.administer.PermissionsVO">
        SELECT DISTINCT
            t4.*
        FROM
            role_administer_mapping t
        LEFT JOIN role_dict t2 ON t.role_id = t2.id
        LEFT JOIN role_permission_mapping t3 ON t2.id = t3.role_id
        LEFT JOIN permissions_dict t4 ON t3.permission_id = t4.id
        WHERE
            t.delete_date IS NULL
        AND t2.delete_date IS NULL
        AND t3.delete_date IS NULL
        AND t4.delete_date IS NULL
        <if test="id !=null and id !=''">
            and t.administer_id = #{id}
        </if>

    </select>


</mapper>