Browse Source

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

ywx
王宁 8 months ago
parent
commit
1c6add4530

+ 5
- 2
src/main/java/com/xhkjedu/controller/EPaperVerifyController.java View File

@@ -5,9 +5,10 @@ import com.xhkjedu.model.EPaperStudent0608;
5 5
 import com.xhkjedu.service.EPaperVerifyService;
6 6
 import com.xhkjedu.utils.N_Utils;
7 7
 import com.xhkjedu.vo.ResultVo;
8
-import lombok.val;
9 8
 import org.springframework.web.bind.annotation.PostMapping;
10 9
 import org.springframework.web.bind.annotation.RequestBody;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RestController;
11 12
 
12 13
 import javax.annotation.Resource;
13 14
 import java.util.List;
@@ -19,6 +20,8 @@ import java.util.Map;
19 20
  * @description 考卷校验
20 21
  * @date 2024/6/8 14:36
21 22
  **/
23
+@RestController
24
+@RequestMapping("/ev")
22 25
 public class EPaperVerifyController {
23 26
     @Resource
24 27
     private EPaperVerifyService ePaperVerifyService;
@@ -29,7 +32,7 @@ public class EPaperVerifyController {
29 32
         Integer examid = student.getExamid();
30 33
         String studentname = student.getStudentname();
31 34
         N_Utils.validation(new Object[]{examid, "考试id", 1, studentname, "姓名", 2});
32
-        List<Map> list = ePaperVerifyService.listStudentByStudentname(examid, studentname);
35
+        List<Map> list = ePaperVerifyService.listStudentByStudentname(examid, studentname, student.getClassid());
33 36
         return new ResultVo(0, "获取成功!", list);
34 37
     }
35 38
 

+ 3
- 1
src/main/java/com/xhkjedu/mapper/EPaperVerifyMapper.java View File

@@ -3,6 +3,7 @@ package com.xhkjedu.mapper;
3 3
 import com.xhkjedu.model.EPaperQtypeQuestion;
4 4
 import com.xhkjedu.model.EPaperStudent0608;
5 5
 import org.apache.ibatis.annotations.Param;
6
+import org.springframework.stereotype.Repository;
6 7
 
7 8
 import java.util.List;
8 9
 import java.util.Map;
@@ -13,9 +14,10 @@ import java.util.Map;
13 14
  * @description todo
14 15
  * @date 2024/6/8 14:44
15 16
  **/
17
+@Repository
16 18
 public interface EPaperVerifyMapper {
17 19
     //根据姓名搜索学生信息
18
-    List<Map> listStudentByStudentname(@Param("examid") Integer examid,@Param("studentname") String studentname);
20
+    List<Map> listStudentByStudentname(@Param("examid") Integer examid,@Param("studentname") String studentname,@Param("classid") Integer classid);
19 21
 
20 22
     //获取学生试卷及试题作答
21 23
     Map getStudentPaper(@Param("ps") EPaperStudent0608 ps);

+ 2
- 2
src/main/java/com/xhkjedu/service/EPaperVerifyService.java View File

@@ -20,8 +20,8 @@ public class EPaperVerifyService {
20 20
     private EPaperVerifyMapper ePaperVerifyMapper;
21 21
 
22 22
     //根据姓名搜索学生信息
23
-    public List<Map> listStudentByStudentname(Integer examid, String studentname) {
24
-        return ePaperVerifyMapper.listStudentByStudentname(examid, studentname);
23
+    public List<Map> listStudentByStudentname(Integer examid, String studentname, Integer classid) {
24
+        return ePaperVerifyMapper.listStudentByStudentname(examid, studentname, classid);
25 25
     }
26 26
 
27 27
     //获取学生试卷及试题作答

+ 4
- 2
src/main/resources/EPaperVerifyMapper.xml View File

@@ -7,7 +7,9 @@
7 7
         from e_class_student s left join e_class c on s.examid=c.examid and c.classid=c.classid
8 8
         LEFT JOIN t_user u on s.studentid=u.userid
9 9
         left join e_base e on c.examid=e.examid
10
-        where s.examid=#{examid} and u.usertype=2 and u.username like concat('%', #{studentname}, '%') group by s.studentid
10
+        where s.examid=#{examid} and u.usertype=2 and u.username like concat('%', #{studentname}, '%')
11
+        <if test="classid!=null and classid!=0">and s.classid=#{classid}</if>
12
+        group by s.studentid
11 13
     </select>
12 14
 
13 15
     <!--获取学生试卷及试题作答-->
@@ -44,7 +46,7 @@
44 46
     <!--识别正确跳过-->
45 47
     <update id="correctSkip">
46 48
         UPDATE e_paper_student0608 ps LEFT JOIN e_paper_student ps2 ON ps.epsid=ps2.epsid
47
-        SET ps.verified=1,ps2.verified=1 WHERE ps.epsid=#{epsid}
49
+        SET ps.verified=1,ps.samed=1,ps2.verified=1 WHERE ps.epsid=#{epsid}
48 50
     </update>
49 51
 
50 52
     <!--获取原试卷中试题正确答案-->

+ 2
- 2
src/main/resources/application.properties View File

@@ -22,8 +22,8 @@ spring.datasource.hikari.connection-timeout=20000
22 22
 # \u6D4B\u8BD5\u8FDE\u63A5\u662F\u5426\u53EF\u7528\u7684query \u8BED\u53E5 \u5728oracle\u662F select 1 from dual  36   28.26
23 23
 spring.datasource.hikari.connection-test-query=SELECT 1
24 24
 # \u6240\u6709Entity\u522B\u540D\u7C7B\u6240\u5728\u5305
25
-mybatis.type-aliases-package=com.xhkjedu.sexam.model,com.xhkjedu.sexam.vo
26
-mybatis.mapper-Locations=classpath*:mapper/**/*.xml
25
+mybatis.type-aliases-package=com.xhkjedu.model,com.xhkjedu.vo
26
+mybatis.mapper-Locations=classpath*:*.xml
27 27
 mybatis.configuration.call-setters-on-nulls=true
28 28
 mapper.mappers=com.xhkjedu.base.TkMapper
29 29
 mapper.identity=MYSQL

Loading…
Cancel
Save