# NOTIN 和 NOT EXIST在SQL查询中性能比较差,可以用LEFT JOIN链接两个表,然后通过ISNOT NULL获取值
mysql> SELECT SP.permissionId, permissionName FROM system_permission SP LEFT JOIN (SELECT roleId, permissionId FROM system_role_permission WHERE roleId = #{value}) T ON SP.permissionId = T.permissionId WHERE T.roleId IS NULL