<?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.xunmei.core.edu.mapper.CoreEduTrainingPlanToRoleMapper">
    <select id="selectRoleNameByPlanId" resultType="com.xunmei.common.core.domain.edu.vo.CoreEduTrainingPlanRoleVo">
        select r.id as roleId, r.role_name as roleName
        from core_edu_training_plan_to_role pr
                 inner join sys_role r on pr.role_id = r.id
        where pr.plan_id = #{planId}
    </select>

    <select id="selectListByPlanId" resultType="com.xunmei.common.core.domain.edu.domain.CoreEduTrainingPlanToRole">
        select pr.plan_id as planId, pr.role_id as roleId, r.role_name as roleName
        from core_edu_training_plan_to_role pr
                 inner join sys_role r on pr.role_id = r.id
        where plan_id = #{planId}
    </select>
</mapper>