浏览代码

学生端考试列表已结束

tags/正式版本
王宁 2 年前
父节点
当前提交
6ef0d9974b

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java 查看文件

@@ -34,14 +34,14 @@ public class EPaperStudentController {
34 34
         N_Utils.validation(new Object[]{eps.getStudentid(),"学生id",1});
35 35
         if(eps.getSstate() == 1){
36 36
            //进行中
37
-            List<Map> rtnlst = ePaperStudentService.listExamPaperForStudent(eps);
37
+            List<Map> rtnlst = ePaperStudentService.listExamPapersForStudent(eps);
38 38
             return new ResultVo(0,"成功获取考试列表",rtnlst);
39 39
         }else{
40 40
             Integer page = eps.getPage();
41 41
             Integer pageSize = eps.getPageSize();
42 42
             N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1});
43 43
             PageHelper.startPage(page, pageSize);
44
-            List<Map> rtnlst = ePaperStudentService.listExamPaperForStudent(eps);
44
+            List<Map> rtnlst = ePaperStudentService.listExamsEndForStudent(eps);
45 45
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(rtnlst));
46 46
             return new ResultVo(0,"成功获取考试列表",pageResult);
47 47
         }

+ 5
- 2
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java 查看文件

@@ -17,6 +17,9 @@ import java.util.Map;
17 17
 @Repository
18 18
 public interface EPaperStudentMapper extends TkMapper<EPaperStudent> {
19 19
 
20
-    //学生考试列表
21
-    List<Map> listExamPaperForStudent(@Param("eps")EPaperStudent eps);
20
+    //学生进行中考试列表
21
+    List<Map> listExamPapersForStudent(@Param("studentid")Integer studentid);
22
+
23
+    //学生已结束考试列表
24
+    List<Map> listExamsEndForStudent(@Param("studentid")Integer studentid);
22 25
 }

+ 27
- 3
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java 查看文件

@@ -19,14 +19,38 @@ public class EPaperStudentService {
19 19
     private EPaperStudentMapper ePaperStudentMapper;
20 20
 
21 21
     /**
22
-     * @Description  学生试列表
22
+     * @Description  学生进行中考试列表
23 23
      * @Param [eps]
24 24
      * @Return java.util.List<java.util.Map>
25 25
      * @Author wn
26 26
      * @Date 2022/7/27 10:35
27 27
      **/
28
-    public List<Map> listExamPaperForStudent(EPaperStudent eps){
29
-        return ePaperStudentMapper.listExamPaperForStudent(eps);
28
+    public List<Map> listExamPapersForStudent(EPaperStudent eps){
29
+        return ePaperStudentMapper.listExamPapersForStudent(eps.getStudentid());
30
+    }
31
+
32
+    /** 学生已结束考试列表
33
+     * @Description
34
+     * @Param [eps]
35
+     * @Return java.util.List<java.util.Map>
36
+     * @Author wn
37
+     * @Date 2022/7/27 11:34
38
+     **/
39
+    public List<Map> listExamsEndForStudent(EPaperStudent eps){
40
+        return ePaperStudentMapper.listExamsEndForStudent(eps.getStudentid());
41
+    }
42
+
43
+    /**
44
+     * @Description 开始考试
45
+     * @Param [eps]
46
+     * @Return java.util.Map
47
+     * @Author wn
48
+     * @Date 2022/7/27 11:48
49
+     **/
50
+    public Map startPaper(EPaperStudent eps){
51
+
52
+        Map map = null;
53
+        return map;
30 54
     }
31 55
 
32 56
 }

+ 1
- 1
sexam/src/main/resources/mapper/paper/EPaperMapper.xml 查看文件

@@ -15,7 +15,7 @@
15 15
     <!--教师出卷列表-->
16 16
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
17 17
         select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate
18
-        ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,es.examid,e.examname,e.examtype
18
+        ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,es.examid,e.examname,e.examtype,e.exammode
19 19
         from e_subject es left join e_paper ep on es.esid=ep.esid
20 20
         left join e_base e on es.examid=e.examid
21 21
         left join t_user u on ep.handleid=u.userid

+ 26
- 11
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml 查看文件

@@ -3,24 +3,39 @@
3 3
 <mapper namespace="com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper">
4 4
 
5 5
     <!--学生进行中考试列表-->
6
-    <select id="listExamPaperForStudent" resultType="java.util.Map">
7
-        select es.esid,es.examid,es.subjectid,ts.subjectname,es.sdate,es.begintime,es.endtime,
8
-               e.examname,e.gradeid,e.examtype,ep.epid
9
-        from e_subject es left join e_paper ep on es.esid=ep.esid
10
-        left join e_base e on es.examid=e.examid
11
-        left join e_class_student s on es.examid=s.examid
12
-        left join t_subject ts on es.subjectid=ts.subjectid
13
-        where s.studentid=#{eps.studentid} and e.examstate=1
6
+    <select id="listExamPapersForStudent" resultType="java.util.Map">
7
+        select es.esid,es.examid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,
8
+        e.examname,e.gradeid,e.examtype,ep.epid
9
+        from e_paper_student eps left join e_subject es on eps.esid=es.esid
10
+         left join e_paper ep on eps.epid=ep.epid left join e_base e on eps.examid=e.examid
11
+        where eps.studentid=#{studentid} and e.examstate=1
14 12
         order by abs(UNIX_TIMESTAMP(concat(es.sdate,' ',es.begintime))-UNIX_TIMESTAMP())
15 13
     </select>
16 14
 
17
-    <!--学生及已结束考试-->
18
-    <select id="listExamsForStudent" resultType="java.util.Map">
15
+    <resultMap id="examsEndForStu" type="java.util.Map">
16
+        <result property="examid" column="examid"></result>
17
+        <result property="examname" column="examname"></result>
18
+        <result property="examdate" column="examdate"></result>
19
+        <result property="gradeid" column="gradeid"></result>
20
+        <result property="examtype" column="examtype"></result>
21
+        <result property="exammode" column="exammode"></result>
22
+        <result property="examcomm" column="examcomm"></result>
23
+        <collection property="subjects" ofType="java.util.Map" javaType="java.util.List">
24
+            <result property="esid" column="esid"></result>
25
+            <result property="subjectid" column="subjectid"></result>
26
+            <result property="subjectname" column="subjectname"></result>
27
+            <result property="sdate" column="sdate"></result>
28
+            <result property="begintime" column="begintime"></result>
29
+            <result property="endtime" column="endtime"></result>
30
+        </collection>
31
+    </resultMap>
32
+    <!--学生已结束考试列表-->
33
+    <select id="listExamsEndForStudent" resultMap="examsEndForStu">
19 34
         select e.examid,e.examname,e.examdate,e.gradeid,e.examtype,e.exammode,e.examcomm,
20 35
                es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime
21 36
         from e_subject es left join e_base e on es.examid=e.examid
22 37
                           left join e_class_student cs on es.examid=cs.examid
23
-        where cs.studentid=14 and e.examstate=0 group by es.esid
38
+        where cs.studentid=#{studentid} and e.examstate=2 group by es.esid
24 39
         order by e.examdate desc,es.sdate desc,es.begintime desc
25 40
     </select>
26 41
 

正在加载...
取消
保存