<?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.sexam.mapper.exam.EClassStudentMapper">
    <!--获取班级学生列表-->
    <select id="listByClassIds" resultType="com.xhkjedu.sexam.model.exam.EClassStudent">
        select classid,studentid from t_class_student
        where classid in
        <foreach collection="classids" item="classid" index="index" open="(" separator="," close=")">
            ${classid}
        </foreach>
    </select>
    <!--考试学生-->
    <select id="listByExamId" resultType="java.util.Map">
        select es.ecsid,es.classid,u.username,u.studentno,u.usersex
        from e_class_student es left join t_user u on es.studentid = u.userid
        where es.examid=#{cs.examid}
        <if test="cs.classid!=null and cs.classid!=0">
            and es.classid=#{cs.classid}
        </if>
        <if test="cs.studentname!=null and cs.studentname!=''">
            and (u.username like '%${cs.studentname}%' or u.studentno like '%${cs.studentname}%')
        </if>
    </select>

    <select id="listClassStuByExamid" resultType="java.util.Map">

    </select>
</mapper>
