<?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.ym.mec.cms.dal.dao.StudentRegistrationDao">

    <select id="countStudentMemberGroupNum" resultType="int">
        SELECT COUNT(DISTINCT sr.music_group_id_)
        FROM student_registration sr
            LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
        WHERE sr.music_group_status_ IN ('APPLY', 'NORMAL')
          AND mg.course_view_type_=2
          AND mg.status_ NOT IN ('CANCELED', 'CLOSE')
          AND sr.user_id_ = #{studentId}
    </select>

</mapper>
