<?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.smarking.mapper.report.reportstu.MsrStudentActionMapper">
    <!--行为分析-学生-->
    <select id="listXwBj" resultType="java.util.Map">
        select c.classname,sa.classid,sa.studentid,sa.subjectjson,u.username,u.loginname
        from msr_student_action sa left join t_class c on sa.classid = c.classid
        left join t_user u on sa.studentid=u.userid
        where sa.examid=#{action.examid} and sa.actiontype=#{action.actiontype}
        <if test="action.classid!=null and action.classid!=0">
            and sa.classid=#{action.classid}
        </if>
        <foreach collection="action.classids" item="classid" open="and sa.classid in(0," separator="," close=")">
            ${classid}
        </foreach>
        <if test="action.createname!=null and action.createname!=''">
            and (u.username like '%${action.createname}%' or u.loginname like '%${action.createname}%')
        </if>
        order by c.classtype,c.classorder,c.classid
    </select>
</mapper>
