|
|
@@ -13,24 +13,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="directKey" column="direct_key" />
|
|
|
<result property="paperId" column="paper_id" />
|
|
|
<result property="classId" column="class_id" />
|
|
|
+ <result property="schoolId" column="school_id" />
|
|
|
+ <result property="campusId" column="campus_id" />
|
|
|
+ <result property="planId" column="plan_id" />
|
|
|
+ <result property="creatorId" column="creator_id" />
|
|
|
<result property="examineeId" column="examinee_id" />
|
|
|
<result property="status" column="status" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectLearnTestStudentVo">
|
|
|
- select id, batch_id, student_id, build_type, subject_id, direct_key, paper_id, class_id, examinee_id, status, create_time from learn_test_student
|
|
|
+ select id, batch_id, student_id, build_type, subject_id, direct_key, paper_id, class_id, school_id, campus_id, plan_id, creator_id, examinee_id, status, create_time from learn_test_student
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectExamineeTestList" resultType="com.alibaba.fastjson2.JSONObject">
|
|
|
- select ts.id, p.`paperName` `name`, ts.`subject_id` subjectId, ts.`create_time` beginTime, p.`fenshu` total, e.`end_time` endTime, if(e.`state` is null, 2, e.`state`) `state`, e.`score`
|
|
|
- from `learn_test_student` ts
|
|
|
- join `learn_paper` p on ts.`paper_id` = p.`id`
|
|
|
- left join `learn_examinee` e on ts.`examinee_id` = e.`examinee_id`
|
|
|
+ SELECT ts.id, p.`paperName` `name`, ts.`subject_id` subjectId, ts.`create_time` beginTime, p.`fenshu` total, e.`end_time` endTime, IF(e.`state` IS NULL, 2, e.`state`) `state`, e.`score`
|
|
|
+ , ts.create_time publishTime, u.`nick_name` publishUser, p.`direct_key` directKey, us.`name` universityName, sr.`name` schoolName, sc.`name` campusName, mp.`majorName`, ts.`class_id` classId
|
|
|
+ FROM `learn_test_student` ts
|
|
|
+ JOIN `learn_paper` p ON ts.`paper_id` = p.`id`
|
|
|
+ LEFT JOIN `learn_examinee` e ON ts.`examinee_id` = e.`examinee_id` AND ts.`student_id` = 34
|
|
|
+ LEFT JOIN sys_user u ON ts.`creator_id` = u.`user_id`
|
|
|
+ LEFT JOIN `dz_school` sr ON ts.`school_id` = sr.`id`
|
|
|
+ LEFT JOIN `dz_school` sc ON ts.`campus_id` = sc.`id`
|
|
|
+ LEFT JOIN `a_marjor_plan` mp ON ts.`plan_id` = mp.`id`
|
|
|
+ LEFT JOIN `b_busi_wish_universities` us ON SUBSTRING_INDEX(p.`direct_key`, '_', 1) = us.`id`
|
|
|
<where>
|
|
|
<if test="studentId != null "> and ts.`student_id` = #{studentId}</if>
|
|
|
+ <if test="status != null and status != 4"> and IF(e.`state` IS NULL, 2, e.`state`) < 4</if>
|
|
|
+ <if test="status != null and status == 4"> and e.`state` >= 4</if>
|
|
|
</where>
|
|
|
- order by ts.`create_time` desc
|
|
|
+ ORDER BY ts.`create_time` DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDirectedStudentList" parameterType="LearnTestStudent" resultMap="LearnTestStudentResult">
|
|
|
@@ -43,6 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="directKey != null and directKey != ''"> and direct_key = #{directKey}</if>
|
|
|
<if test="paperId != null "> and paper_id = #{paperId}</if>
|
|
|
<if test="classId != null "> and class_id = #{classId}</if>
|
|
|
+ <if test="schoolId != null "> and school_id = #{schoolId}</if>
|
|
|
+ <if test="campusId != null "> and campus_id = #{campusId}</if>
|
|
|
+ <if test="planId != null "> and plan_id = #{planId}</if>
|
|
|
+ <if test="creatorId != null "> and creator_id = #{creatorId}</if>
|
|
|
<if test="examineeId != null "> and examinee_id = #{examineeId}</if>
|
|
|
<if test="status != null "> and status = #{status}</if>
|
|
|
</where>
|
|
|
@@ -63,6 +79,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="directKey != null and directKey != ''"> and direct_key = #{directKey}</if>
|
|
|
<if test="paperId != null "> and paper_id = #{paperId}</if>
|
|
|
<if test="classId != null "> and class_id = #{classId}</if>
|
|
|
+ <if test="schoolId != null "> and school_id = #{schoolId}</if>
|
|
|
+ <if test="campusId != null "> and campus_id = #{campusId}</if>
|
|
|
+ <if test="planId != null "> and plan_id = #{planId}</if>
|
|
|
+ <if test="creatorId != null "> and creator_id = #{creatorId}</if>
|
|
|
<if test="examineeId != null "> and examinee_id = #{examineeId}</if>
|
|
|
<if test="status != null "> and status = #{status}</if>
|
|
|
</where>
|
|
|
@@ -83,6 +103,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="directKey != null and directKey != ''">direct_key,</if>
|
|
|
<if test="paperId != null">paper_id,</if>
|
|
|
<if test="classId != null">class_id,</if>
|
|
|
+ <if test="schoolId != null">school_id,</if>
|
|
|
+ <if test="campusId != null">campus_id,</if>
|
|
|
+ <if test="planId != null">plan_id,</if>
|
|
|
+ <if test="creatorId != null">creator_id,</if>
|
|
|
<if test="examineeId != null">examinee_id,</if>
|
|
|
<if test="status != null">status,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
@@ -95,6 +119,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="directKey != null and directKey != ''">#{directKey},</if>
|
|
|
<if test="paperId != null">#{paperId},</if>
|
|
|
<if test="classId != null">#{classId},</if>
|
|
|
+ <if test="schoolId != null">#{schoolId},</if>
|
|
|
+ <if test="campusId != null">#{campusId},</if>
|
|
|
+ <if test="planId != null">#{planId},</if>
|
|
|
+ <if test="creatorId != null">#{creatorId},</if>
|
|
|
<if test="examineeId != null">#{examineeId},</if>
|
|
|
<if test="status != null">#{status},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|