<?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.xhkjedu.sapi.mapper.system.SchoolUpMapper">

    <!--获取年份年级对应的班级-->
    <select id="listClassByYearAndGrade" resultType="com.xhkjedu.sapi.vo.gradeclass.ClassVo">
        select classid,classname,classnum,createid,createtime from t_class where schoolid=#{schoolid} and classstate=1
        and classtype=2 and year=#{year} and gradeid=#{gradeid}
    </select>

    <!--获取班级人数-->
    <select id="getClassStunum" resultType="java.lang.Integer">
        select count(*) from t_class_student where classid=#{classid}
    </select>

    <!--获取所有班级下学生Id-->
    <select id="listStudentidByClassid" resultType="java.lang.Integer">
        select distinct studentid from t_class_student where classid=#{classid}
    </select>

    <!--获取班级对应的小组Id-->
    <select id="getGroupidByClassid" resultType="java.lang.Integer">
        select groupid from t_group where classid=#{classid} and grouptype=1
    </select>

    <!--获取小组人数-->
    <select id="getGroupStunum" resultType="java.lang.Integer">
        select count(*) from t_group_student where groupid=#{groupid}
    </select>

</mapper>
