|
|
@@ -9,12 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="classId" column="class_id" />
|
|
|
<result property="campusId" column="campus_id" />
|
|
|
<result property="universityId" column="university_id" />
|
|
|
+ <result property="directKey" column="direct_key" />
|
|
|
<result property="majorGroup" column="major_group" />
|
|
|
<result property="majorPlanId" column="major_plan_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectLearnStudentVo">
|
|
|
- select student_id, class_id, campus_id, university_id, major_group,major_plan_id from learn_student
|
|
|
+ select student_id, class_id, campus_id, university_id,direct_key, major_group,major_plan_id from learn_student
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectLearnStudentList" parameterType="LearnStudent" resultMap="LearnStudentResult">
|
|
|
@@ -37,7 +38,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="planIds != null and planIds.size() > 0"> AND ls.`major_plan_id` IN <foreach item="id" collection="planIds" open="(" separator="," close=")">#{id}</foreach></if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
+ <select id="selectClassStudents" resultMap="LearnStudentResult">
|
|
|
+ SELECT ls.*, u.nick_name studentName , tp.`paper_id` paperId, ts.`status`
|
|
|
+ FROM `learn_student` ls
|
|
|
+ JOIN `sys_user` u ON ls.`student_id` = u.`user_id`
|
|
|
+ LEFT JOIN `learn_test_paper` tp ON tp.`batch_id` = #{batchId} AND tp.`direct_key` = ls.`direct_key`
|
|
|
+ LEFT JOIN `learn_test_student` ts ON ts.`batch_id` = #{batchId} AND ls.`student_id` = ts.`student_id`
|
|
|
+ where ts.`id` IS NULL AND ls.`class_id` IN <foreach item="id" collection="classIds" open="(" separator="," close=")">#{id}</foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<select id="selectLearnStudentByStudentId" parameterType="Long" resultMap="LearnStudentResult">
|
|
|
<include refid="selectLearnStudentVo"/>
|
|
|
where student_id = #{studentId}
|
|
|
@@ -50,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="classId != null">class_id,</if>
|
|
|
<if test="campusId != null">campus_id,</if>
|
|
|
<if test="universityId != null">university_id,</if>
|
|
|
+ <if test="directKey != null">direct_key,</if>
|
|
|
<if test="majorGroup != null">major_group,</if>
|
|
|
<if test="majorPlanId != null">major_plan_id,</if>
|
|
|
</trim>
|
|
|
@@ -58,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="classId != null">#{classId},</if>
|
|
|
<if test="campusId != null">#{campusId},</if>
|
|
|
<if test="universityId != null">#{universityId},</if>
|
|
|
+ <if test="directKey != null">#{directKey},</if>
|
|
|
<if test="majorGroup != null">#{majorGroup},</if>
|
|
|
<if test="majorPlanId != null">#{majorPlanId},</if>
|
|
|
</trim>
|
|
|
@@ -69,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="classId != null">class_id = #{classId},</if>
|
|
|
<if test="campusId != null">campus_id = #{campusId},</if>
|
|
|
<if test="universityId != null">university_id = #{universityId},</if>
|
|
|
+ <if test="directKey != null">direct_key = #{directKey},</if>
|
|
|
<if test="majorGroup != null">major_group = #{majorGroup},</if>
|
|
|
<if test="majorPlanId != null">major_plan_id = #{majorPlanId},</if>
|
|
|
</trim>
|