Browse Source

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 2 years ago
parent
commit
96971008be

+ 19
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperController.java View File

2
 
2
 
3
 import com.xhkjedu.sexam.model.exam.ESubject;
3
 import com.xhkjedu.sexam.model.exam.ESubject;
4
 import com.xhkjedu.sexam.model.paper.EPaper;
4
 import com.xhkjedu.sexam.model.paper.EPaper;
5
+import com.xhkjedu.sexam.model.paper.EPaperBack;
5
 import com.xhkjedu.sexam.service.paper.EPaperService;
6
 import com.xhkjedu.sexam.service.paper.EPaperService;
6
 import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.vo.ResultVo;
8
 import com.xhkjedu.vo.ResultVo;
31
         return new ResultVo(0,"成功获取考试试卷信息",list);
32
         return new ResultVo(0,"成功获取考试试卷信息",list);
32
     }
33
     }
33
 
34
 
35
+    //退回试卷
36
+    @PostMapping("/sb")
37
+    public ResultVo saveExamPaperBack(@RequestBody EPaperBack ePaperBack){
38
+        N_Utils.validation(new Object[]{ePaperBack.getEpid(),"试卷id",1});
39
+        ePaperService.savePaperBack(ePaperBack);
40
+        return new ResultVo(0,"成功退回试卷",null);
41
+    }
42
+
43
+    //试卷退回列表
44
+    @PostMapping("/bl")
45
+    public ResultVo listPaperBacks(@RequestBody EPaperBack ePaperBack){
46
+        N_Utils.validation(new Object[]{ePaperBack.getEpid(),"试卷id",1});
47
+        List<Map> list = ePaperService.listPaperBacksByEpid(ePaperBack.getEpid());
48
+        return new ResultVo(0,"成功获取试卷退回原因",list);
49
+    }
50
+
51
+
52
+
34
     //教师出卷列表
53
     //教师出卷列表
35
     @PostMapping("/listt")
54
     @PostMapping("/listt")
36
     public ResultVo examTeacherPaperList(@RequestBody ESubject subject){
55
     public ResultVo examTeacherPaperList(@RequestBody ESubject subject){

+ 13
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperFjtypeController.java View File

1
 package com.xhkjedu.sexam.controller.paper;
1
 package com.xhkjedu.sexam.controller.paper;
2
 
2
 
3
+import com.xhkjedu.sexam.model.paper.EPaper;
3
 import com.xhkjedu.sexam.service.paper.EPaperFjtypeService;
4
 import com.xhkjedu.sexam.service.paper.EPaperFjtypeService;
5
+import com.xhkjedu.utils.N_Utils;
6
+import com.xhkjedu.vo.ResultVo;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
4
 import org.springframework.web.bind.annotation.RequestMapping;
9
 import org.springframework.web.bind.annotation.RequestMapping;
5
 import org.springframework.web.bind.annotation.RestController;
10
 import org.springframework.web.bind.annotation.RestController;
6
 
11
 
7
 import javax.annotation.Resource;
12
 import javax.annotation.Resource;
8
-
9
 /**
13
 /**
10
  * @Description 附件试卷
14
  * @Description 附件试卷
11
  * @Author WN
15
  * @Author WN
18
     @Resource
22
     @Resource
19
     private EPaperFjtypeService ePaperFjtypeService;
23
     private EPaperFjtypeService ePaperFjtypeService;
20
 
24
 
25
+    //保存试卷信息
26
+    @PostMapping("/save")
27
+    public ResultVo savePaperFj(@RequestBody EPaper paper){
28
+        N_Utils.validation(new Object[]{paper.getExamid(),"考试id",1});
29
+        ePaperFjtypeService.saveFjPaper(paper);
30
+        return new ResultVo(0,"成功保存试卷信息",null);
31
+    }
32
+
21
 }
33
 }

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectMapper.java View File

13
 
13
 
14
     //考试下所有科目
14
     //考试下所有科目
15
     List<ESubjectVo> listExamSubjects(@Param("examid") Integer examid);
15
     List<ESubjectVo> listExamSubjects(@Param("examid") Integer examid);
16
+
17
+    //更新考试科目状态
18
+    void updateExamSubjectState(@Param("esubject") ESubject esubject);
19
+
20
+    //根据试卷id更新考试科目状态
21
+    void updateEsubjectStateByEpid(@Param("esstate") Integer esstate,@Param("epid") Integer epid);
16
 }
22
 }

+ 19
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperBackMapper.java View File

1
+package com.xhkjedu.sexam.mapper.paper;
2
+
3
+import com.xhkjedu.sexam.base.TkMapper;
4
+import com.xhkjedu.sexam.model.paper.EPaperBack;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+/**
11
+ * @Description 试卷回退
12
+ * @Author WN
13
+ * Date 2022/7/18 16:38
14
+ **/
15
+public interface EPaperBackMapper extends TkMapper<EPaperBack> {
16
+
17
+    //获取试卷退回原因
18
+    List<Map> listPaperBacksByEpid(@Param("epid")Integer epid);
19
+}

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperMapper.java View File

21
 
21
 
22
     //教师出卷列表
22
     //教师出卷列表
23
     List<Map> listExamPapersByTeacherid(@Param("teacherid") Integer teacherid);
23
     List<Map> listExamPapersByTeacherid(@Param("teacherid") Integer teacherid);
24
+
25
+    //试卷详情
26
+    Map getExamPaperDetailByEpid(@Param("epid") Integer epid);
24
 }
27
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/paper/EPaper.java View File

33
     //试卷总分
33
     //试卷总分
34
     private Double pscore;
34
     private Double pscore;
35
 
35
 
36
+    //是否设置正确答案0未设置1已设置
37
+    private Integer answered;
38
+
36
     //批阅设置:1按班设置2按题设置
39
     //批阅设置:1按班设置2按题设置
37
     private Integer correcttype;
40
     private Integer correcttype;
38
 
41
 

+ 55
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperFjtypeService.java View File

1
 package com.xhkjedu.sexam.service.paper;
1
 package com.xhkjedu.sexam.service.paper;
2
 
2
 
3
+import com.alibaba.fastjson.JSON;
3
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
4
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
4
 import com.xhkjedu.sexam.mapper.paper.*;
5
 import com.xhkjedu.sexam.mapper.paper.*;
5
 import com.xhkjedu.sexam.model.exam.ESubject;
6
 import com.xhkjedu.sexam.model.exam.ESubject;
6
 import com.xhkjedu.sexam.model.paper.*;
7
 import com.xhkjedu.sexam.model.paper.*;
8
+import com.xhkjedu.sexam.vo.paper.EPaperQsVo;
7
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.N_Utils;
8
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
11
+import org.springframework.transaction.annotation.Transactional;
9
 
12
 
10
 import javax.annotation.Resource;
13
 import javax.annotation.Resource;
11
 import java.util.ArrayList;
14
 import java.util.ArrayList;
15
+import java.util.HashMap;
12
 import java.util.List;
16
 import java.util.List;
17
+import java.util.Map;
13
 import java.util.stream.Collectors;
18
 import java.util.stream.Collectors;
14
 
19
 
15
 /**
20
 /**
32
     @Resource
37
     @Resource
33
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
38
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
34
 
39
 
35
-
40
+    //保存试卷
41
+    @Transactional(rollbackFor = Exception.class)
36
     public void saveFjPaper(EPaper paper){
42
     public void saveFjPaper(EPaper paper){
37
         int epid = 0;
43
         int epid = 0;
38
 
44
 
57
         paper.setCreatetime(timestamp);
63
         paper.setCreatetime(timestamp);
58
         paper.setHandletime(timestamp);
64
         paper.setHandletime(timestamp);
59
         paper.setHandleid(paper.getCreateid());
65
         paper.setHandleid(paper.getCreateid());
66
+        paper.setAnswered(0);
60
         ePaperMapper.insertUseGeneratedKeys(paper);
67
         ePaperMapper.insertUseGeneratedKeys(paper);
61
         epid = paper.getId();
68
         epid = paper.getId();
62
         paper.setEpid(epid);
69
         paper.setEpid(epid);
65
         savePaperFile(paper);
72
         savePaperFile(paper);
66
         //保存答题卡信息
73
         //保存答题卡信息
67
         saveFjtypeQuestion(paper,fjtypelist);
74
         saveFjtypeQuestion(paper,fjtypelist);
68
-
75
+        //更加试卷状态是否需要生成分析和更改科目状态
69
         if(paper.getPstate()!=null && paper.getPstate() == 1){
76
         if(paper.getPstate()!=null && paper.getPstate() == 1){
70
-            //如果提交试卷,则生成试卷分析
77
+            //如果提交试卷,则生成试卷分析,更改科目状态
71
             savePaperAnalyze(paper,fjtypelist,queslist);
78
             savePaperAnalyze(paper,fjtypelist,queslist);
79
+            eSubject.setEsstate(1);
80
+            eSubjectMapper.updateExamSubjectState(eSubject);
72
         }
81
         }
73
     }
82
     }
74
 
83
 
127
         double zscore = 0;
136
         double zscore = 0;
128
         int knum = 0;
137
         int knum = 0;
129
         double kscore = 0;
138
         double kscore = 0;
130
-        
139
+        for(EPaperFjtypeQuestion q : queslist){
140
+            if(q.getCtype() == 3 || q.getCtype() == 11){
141
+                znum ++;
142
+                zscore = zscore + q.getScore();
143
+            }else{
144
+                knum ++;
145
+                kscore = kscore + q.getScore();
146
+            }
147
+        }
148
+
149
+        double znumrate = N_Utils.getIntegerDivideAndMulitiply(znum, ePaper.getPnum());
150
+        double knumrate = 100-znumrate;
151
+        double zscorerate = N_Utils.getDoubleDivideAndMulitiply(zscore, ePaper.getPscore());
152
+        double kscorerate = 100 - zscorerate;
153
+
154
+        List<EPaperQsVo> ranglist = new ArrayList<>();
155
+        ranglist.add(new EPaperQsVo("主观题",zscore,znum,zscorerate,znumrate));
156
+        ranglist.add(new EPaperQsVo("客观题",kscore,knum,kscorerate,knumrate));
131
 
157
 
158
+        Map ztmap = new HashMap<>();
159
+        ztmap.put("pnum", ePaper.getPnum());
160
+        ztmap.put("pscore",ePaper.getPscore());
161
+        ztmap.put("ranglist",ranglist);
162
+
163
+        //题型分布
164
+        List<EPaperQsVo> qtlist = new ArrayList<>();
165
+        for(EPaperFjtype fjt : fjtypelist){
166
+            EPaperQsVo qvo = new EPaperQsVo();
167
+            qvo.setQtname(fjt.getEpfjname());
168
+            qvo.setNum(fjt.getEpfjnum());
169
+            qvo.setScore(fjt.getEpfjscore());
170
+            double scorerate = N_Utils.getDoubleDivideAndMulitiply(fjt.getEpfjscore(), ePaper.getPscore());
171
+            qvo.setSrate(scorerate);
172
+            qtlist.add(qvo);
173
+        }
174
+
175
+        EPaperAnalyze epa = new EPaperAnalyze();
176
+        epa.setEpaid(ePaper.getEpid());
177
+        epa.setAlljson(JSON.toJSONString(ztmap));
178
+        epa.setQnumjson(JSON.toJSONString(qtlist));
179
+        ePaperAnalyzeMapper.insertUseGeneratedKeys(epa);
180
+    }
132
 
181
 
182
+    //试卷详情
183
+    public void getPaperDetail(Integer epid){
133
 
184
 
134
     }
185
     }
135
 }
186
 }

+ 40
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperService.java View File

1
 package com.xhkjedu.sexam.service.paper;
1
 package com.xhkjedu.sexam.service.paper;
2
 
2
 
3
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
3
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
4
+import com.xhkjedu.sexam.mapper.paper.EPaperBackMapper;
4
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
5
 import com.xhkjedu.sexam.model.paper.EPaper;
6
 import com.xhkjedu.sexam.model.paper.EPaper;
7
+import com.xhkjedu.sexam.model.paper.EPaperBack;
6
 import com.xhkjedu.sexam.vo.exam.ESubjectVo;
8
 import com.xhkjedu.sexam.vo.exam.ESubjectVo;
9
+import com.xhkjedu.utils.N_Utils;
7
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
11
+import org.springframework.transaction.annotation.Transactional;
8
 
12
 
9
 import javax.annotation.Resource;
13
 import javax.annotation.Resource;
10
 import java.util.ArrayList;
14
 import java.util.ArrayList;
23
     @Resource
27
     @Resource
24
     private EPaperMapper ePaperMapper;
28
     private EPaperMapper ePaperMapper;
25
     @Resource
29
     @Resource
30
+    private EPaperBackMapper ePaperBackMapper;
31
+    @Resource
26
     private ESubjectMapper eSubjectMapper;
32
     private ESubjectMapper eSubjectMapper;
27
 
33
 
28
 
34
 
35
+
29
     //考试各科目试卷设置
36
     //考试各科目试卷设置
30
     public List<Map> listExamPapers(Integer examid) {
37
     public List<Map> listExamPapers(Integer examid) {
31
         return ePaperMapper.listExamPapers(examid);
38
         return ePaperMapper.listExamPapers(examid);
32
     }
39
     }
33
 
40
 
41
+    //试卷退回
42
+    @Transactional(rollbackFor = Exception.class)
43
+    public void savePaperBack(EPaperBack ePaperBack){
44
+        int timestamp = N_Utils.getSecondTimestamp();
45
+        ePaperBack.setCreatetime(timestamp);
46
+        ePaperBackMapper.insertUseGeneratedKeys(ePaperBack);
47
+        //更改试卷科目状态
48
+        eSubjectMapper.updateEsubjectStateByEpid(2,ePaperBack.getEpid());
49
+        //试卷回退需要发送通知和短息,后续添加
50
+    }
51
+
52
+    //试卷退回原因
53
+    public List<Map> listPaperBacksByEpid(Integer epid){
54
+        return ePaperBackMapper.listPaperBacksByEpid(epid);
55
+    }
56
+
34
     //教师出卷列表
57
     //教师出卷列表
35
     public List<Map> listExamPapersByTeacherid(Integer teacherid){
58
     public List<Map> listExamPapersByTeacherid(Integer teacherid){
36
         return ePaperMapper.listExamPapersByTeacherid(teacherid);
59
         return ePaperMapper.listExamPapersByTeacherid(teacherid);
37
     }
60
     }
61
+
62
+    //试卷详情
63
+    public Map getExamPaperDetailByEpid(Integer epid){
64
+        Map map = ePaperMapper.getExamPaperDetailByEpid(epid);
65
+        //试卷类型1题库2答题卡3仅答题卡
66
+        int ptype = Integer.parseInt(map.get("ptype").toString());
67
+        if(ptype == 1){
68
+
69
+        }else if(ptype == 2){
70
+
71
+        }else{
72
+
73
+        }
74
+
75
+        return null;
76
+    }
77
+
38
 }
78
 }

+ 34
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperQsVo.java View File

1
+package com.xhkjedu.sexam.vo.paper;
2
+
3
+import lombok.Data;
4
+import org.springframework.format.annotation.DateTimeFormat;
5
+
6
+/**
7
+ * @Description 试卷分值分析
8
+ * @Author WN
9
+ * Date 2022/7/18 15:45
10
+ **/
11
+@Data
12
+public class EPaperQsVo {
13
+
14
+    private String qtname;//名称
15
+
16
+    private double score;//分值
17
+
18
+    private int num;//数量
19
+
20
+    private double srate;//分值占比
21
+
22
+    private double nrate;//数量占比
23
+    public EPaperQsVo(){
24
+
25
+    }
26
+
27
+    public EPaperQsVo(String qtname,double score,int num,double srate,double nrate){
28
+        this.qtname = qtname;
29
+        this.score = score;
30
+        this.num = num;
31
+        this.srate = srate;
32
+        this.nrate = nrate;
33
+    }
34
+}

+ 4
- 3
sexam/src/main/resources/application.properties View File

1
 server.port=8088
1
 server.port=8088
2
 spring.application.name=sexam
2
 spring.application.name=sexam
3
 #注册到我们本地的eureka注册中心,端口8081
3
 #注册到我们本地的eureka注册中心,端口8081
4
-eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
5
-#eureka.client.register-with-eureka=false
6
-#eureka.client.fetch-registry=false
4
+#eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
5
+eureka.client.register-with-eureka=false
6
+eureka.client.fetch-registry=false
7
 #设置eureka输出日志级别
7
 #设置eureka输出日志级别
8
 logging.level.com.netflix=error
8
 logging.level.com.netflix=error
9
 
9
 
29
 # 所有Entity别名类所在包
29
 # 所有Entity别名类所在包
30
 mybatis.type-aliases-package=com.xhkjedu.sexam.model,com.xhkjedu.sexam.vo
30
 mybatis.type-aliases-package=com.xhkjedu.sexam.model,com.xhkjedu.sexam.vo
31
 mybatis.mapper-Locations=classpath*:mapper/**/*.xml
31
 mybatis.mapper-Locations=classpath*:mapper/**/*.xml
32
+mybatis.configuration.call-setters-on-nulls=true
32
 mapper.mappers=com.xhkjedu.sexam.base.TkMapper
33
 mapper.mappers=com.xhkjedu.sexam.base.TkMapper
33
 mapper.identity=MYSQL
34
 mapper.identity=MYSQL
34
 #打印日志
35
 #打印日志

+ 10
- 0
sexam/src/main/resources/mapper/exam/ESubjectMapper.xml View File

17
         left join t_subject s on es.subjectid=s.subjectid
17
         left join t_subject s on es.subjectid=s.subjectid
18
         where es.examid=#{examid} order by s.subjectorder
18
         where es.examid=#{examid} order by s.subjectorder
19
     </select>
19
     </select>
20
+
21
+    <!--根据考试科目id更改考试科目状态-->
22
+    <update id="updateExamSubjectState">
23
+        update e_subject set esstate=#{esubject.esstate} where esid = #{esubject.esid};
24
+    </update>
25
+
26
+    <!--根据试卷id更新考试科目状态-->
27
+    <update id="updateEsubjectStateByEpid">
28
+        update e_subject es,e_paper ep set es.esstate=#{esstate} where es.esid=ep.esid and ep.epid=#{epid}
29
+    </update>
20
 </mapper>
30
 </mapper>

+ 10
- 0
sexam/src/main/resources/mapper/paper/EPaperBackMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.sexam.mapper.paper.EPaperBackMapper">
4
+    <!--试卷退回原因-->
5
+    <select id="listPaperBacksByEpid" resultType="java.util.Map">
6
+        select eb.*,u.username createname
7
+        from e_paper_back eb left join t_user u on eb.createid=u.userid
8
+        where eb.epid=#{epid}
9
+    </select>
10
+</mapper>

+ 28
- 1
sexam/src/main/resources/mapper/paper/EPaperFjtypeMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.xhkjedu.sexam.mapper.paper.EPaperFjtypeMapper">
3
 <mapper namespace="com.xhkjedu.sexam.mapper.paper.EPaperFjtypeMapper">
4
 
4
 
5
-
5
+    <resultMap id="fjtypeQuestions" type="java.util.Map">
6
+        <result column="epfjid" property="epfjid"></result>
7
+        <result column="epid" property="epid"></result>
8
+        <result column="epfjname" property="epfjname"></result>
9
+        <result column="epfjnum" property="epfjnum"></result>
10
+        <result column="epfjorder" property="epfjorder"></result>
11
+        <result column="epfjscore" property="epfjscore"></result>
12
+        <collection property="questions" ofType="java.util.Map">
13
+            <result column="epfjqid" property="epfjqid"></result>
14
+            <result column="epfjid" property="epfjid"></result>
15
+            <result column="epid" property="epid"></result>
16
+            <result column="qtypeid" property="qtypeid"></result>
17
+            <result column="qtypename" property="qtypename"></result>
18
+            <result column="ctype" property="ctype"></result>
19
+            <result column="score" property="score"></result>
20
+            <result column="qn" property="qn"></result>
21
+            <result column="order" property="order"></result>
22
+            <result column="answer" property="answer"></result>
23
+            <result column="optionnum" property="optionnum"></result>
24
+        </collection>
25
+    </resultMap>
26
+    <select id="listPaperFjtypeQuestions" resultMap="fjtypeQuestions">
27
+        select t.epfjid,t.epid,t.epfjname,t.epfjnum,t.epfjorder,t.epfjscore,
28
+               q.epfjqid,q.epfjid,q.epid,q.qtypeid,q.qtypename,q.ctype,q.score,q.qn,q.order,q.answer,q.optionnum
29
+        from e_paper_fjtype t left join e_paper_fjtype_question q on t.epfjid=q.epfjid
30
+        where t.epid=#{epid}
31
+    </select>
32
+    
6
 </mapper>
33
 </mapper>

+ 12
- 2
sexam/src/main/resources/mapper/paper/EPaperMapper.xml View File

5
     <!--获取考试下有科目试卷信息-->
5
     <!--获取考试下有科目试卷信息-->
6
     <select id="listExamPapers" resultType="java.util.Map">
6
     <select id="listExamPapers" resultType="java.util.Map">
7
         select es.esid,es.subjectid,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate,es.ptype
7
         select es.esid,es.subjectid,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate,es.ptype
8
-        ,ep.epid,ep.pnum,ep.pscore,s.subjectname,ep.handleid,u.username as handlename
8
+        ,ep.epid,ep.pnum,ep.pscore,ep.answered,s.subjectname,ep.handleid,u.username as handlename
9
         from e_subject es left join e_paper ep on es.esid=ep.esid
9
         from e_subject es left join e_paper ep on es.esid=ep.esid
10
         left join t_subject s on es.subjectid=s.subjectid
10
         left join t_subject s on es.subjectid=s.subjectid
11
         left join t_user u on ep.handleid=u.userid
11
         left join t_user u on ep.handleid=u.userid
16
     <!--教师出卷列表-->
16
     <!--教师出卷列表-->
17
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
17
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
18
         select es.esid,es.subjectid,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate,es.ptype
18
         select es.esid,es.subjectid,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,es.esstate,es.ptype
19
-        ,ep.epid,ep.pnum,ep.pscore,s.subjectname,ep.handleid,u.username as handlename,es.examid,e.examname
19
+        ,ep.epid,ep.pnum,ep.pscore,ep.answered,s.subjectname,ep.handleid,u.username as handlename,es.examid,e.examname
20
         from e_subject es left join e_paper ep on es.esid=ep.esid
20
         from e_subject es left join e_paper ep on es.esid=ep.esid
21
         left join t_subject s on es.subjectid=s.subjectid
21
         left join t_subject s on es.subjectid=s.subjectid
22
         left join e_base e on es.examid=e.examid
22
         left join e_base e on es.examid=e.examid
25
         where es.teacherid=#{teacherid} order by es.examid desc, s.subjectorder asc
25
         where es.teacherid=#{teacherid} order by es.examid desc, s.subjectorder asc
26
 
26
 
27
     </select>
27
     </select>
28
+
29
+    <!--试卷详情-->
30
+    <select id="getExamPaperDetailByEpid" resultType="java.util.Map">
31
+        select ep.epid,ep.examid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.hearfile,
32
+        ep.handleid,ep.handletime,s.subjectname,u.username as handlename
33
+        from e_paper ep left join e_base e on ep.examid=e.examid
34
+        left join t_subject s on ep.subjectid=s.subjectid
35
+        left join t_user u on ep.handleid=u.userid
36
+        where ep.epid=#{epid}
37
+    </select>
28
 </mapper>
38
 </mapper>

Loading…
Cancel
Save