<?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.yida.data.school.smart.mapper.EduSmartWelcomeGuideRosterRelationStepMapper">

    <!-- 查询报名成功人数 -->
    <select id="countCompleteRoster" resultType="long">
        SELECT
            COUNT( a.roster_id ) AS num
        FROM
            (
                SELECT
                    COUNT( step_id ) AS step_num,
                    roster_id
                FROM
                    edu_smart_welcome_guide_roster_relation_step
                WHERE
                    del_flag = 0
                AND `status` = 0
                AND guide_id = #{guideId}
                GROUP BY
                    roster_id
                HAVING
                    step_num = #{stepNumber}
            ) AS a
    </select>

</mapper>
