<?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.zsc.edu.gateway.modules.system.repo.AuthorityRepository">
<!--    <resultMap  id="AuthorityMap" type="com.zsc.bill.modules.system.entity.Authority">-->
<!--        <id column="id" jdbcType="BIGINT" property="id"/>-->
<!--        <result column="name" jdbcType="VARCHAR" property="name"/>-->
<!--        <result column="create_by" jdbcType="VARCHAR" property="createBy"/>-->
<!--        <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>-->
<!--        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>-->
<!--        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>-->
<!--        <result column="enabled" jdbcType="BOOLEAN" property="enabled"/>-->
<!--        <result column="remark" jdbcType="VARCHAR" property="remark"/>-->
<!--    </resultMap>-->
    
    <select id="selectAuthoritiesByRoleId" resultType="authority">
        select sa.* from sys_authority sa
        left join sys_role_authorities ra on sa.id=ra.authority_id
        where ra.role_id=#{roleId}
    </select>

    <select id="getAuthorityIdByName" resultType="java.lang.Long">
        select sa.id from sys_authority sa
        where sa.name=#{authName}
    </select>
</mapper>