Ver Fonte

增加组卷功能的学生列表接口

mingfu há 1 mês atrás
pai
commit
5419e6b52f

+ 7 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/learn/LearnTeacherController.java

@@ -96,6 +96,13 @@ public class LearnTeacherController extends BaseController {
         return AjaxResult.success(learnTeacherService.getClasses(getUserId()));
     }
 
+    @GetMapping("/students")
+    @ApiOperation("学生列表")
+    public AjaxResult students(@ApiParam("批次ID") Long batchId)
+    {
+        return AjaxResult.success(learnTeacherService.getStudents(batchId, getUserId()));
+    }
+
     @GetMapping("/universities")
     @ApiOperation("院校列表")
     public AjaxResult universities(@ApiParam("批次ID") Long batchId)

+ 4 - 0
ie-admin/src/main/java/com/ruoyi/web/service/LearnTeacherService.java

@@ -62,6 +62,10 @@ public class LearnTeacherService {
         return dzClassesMapper.selectClassesForTeacher(teacherId);
     }
 
+    public List<LearnStudent> getStudents(Long batchId, Long classId) {
+        return learnStudentMapper.selectClassStudents(batchId, new Long[] {classId});
+    }
+
     public List<BBusiWishUniversities> selectUniversityList(Long teacherId, Long batchId) {
         return busiWishUniversitiesMapper.selectUniversityListForTeacher(teacherId, batchId);
     }

+ 51 - 0
ie-system/src/main/java/com/ruoyi/learn/domain/LearnStudent.java

@@ -30,10 +30,21 @@ public class LearnStudent extends BaseEntity
     @Excel(name = "院校id")
     private Long universityId;
 
+    @Excel(name = "定向键")
+    private String directKey;
+
+    @Excel(name = "专业组")
+    private String majorGroup;
+
     /** 计划专业id */
     @Excel(name = "计划专业id")
     private Long majorPlanId;
 
+
+    private String studentName;
+    private String paperId;
+    private Integer status;
+
     public Long getStudentId() {
         return studentId;
     }
@@ -50,6 +61,14 @@ public class LearnStudent extends BaseEntity
         this.classId = classId;
     }
 
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
     public Long getCampusId() {
         return campusId;
     }
@@ -66,6 +85,22 @@ public class LearnStudent extends BaseEntity
         this.universityId = universityId;
     }
 
+    public String getDirectKey() {
+        return directKey;
+    }
+
+    public void setDirectKey(String directKey) {
+        this.directKey = directKey;
+    }
+
+    public String getMajorGroup() {
+        return majorGroup;
+    }
+
+    public void setMajorGroup(String majorGroup) {
+        this.majorGroup = majorGroup;
+    }
+
     public Long getMajorPlanId() {
         return majorPlanId;
     }
@@ -73,4 +108,20 @@ public class LearnStudent extends BaseEntity
     public void setMajorPlanId(Long majorPlanId) {
         this.majorPlanId = majorPlanId;
     }
+
+    public String getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(String paperId) {
+        this.paperId = paperId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
 }

+ 3 - 0
ie-system/src/main/java/com/ruoyi/learn/mapper/LearnStudentMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.learn.domain.LearnStudent;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 学生Mapper接口
@@ -15,6 +16,8 @@ public interface LearnStudentMapper
 {
     public List<LearnStudent> selectLearnStudentsByMap(Map cond);
 
+    public List<LearnStudent> selectClassStudents(@Param("batchId") Long batchId, @Param("classIds") Long[] classIds);
+
     /**
      * 查询学生
      * 

+ 18 - 2
ie-system/src/main/resources/mapper/learn/LearnStudentMapper.xml

@@ -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>