소스 검색

跳过

ywx
雍文秀 6 달 전
부모
커밋
003ac8f7c6

+ 5
- 2
src/main/java/com/xhkjedu/controller/EPaperVerifyController.java 파일 보기

@@ -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 파일 보기

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

+ 2
- 2
src/main/java/com/xhkjedu/service/EPaperVerifyService.java 파일 보기

@@ -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 파일 보기

@@ -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
     <!--获取学生试卷及试题作答-->
@@ -31,6 +33,6 @@
31 33
     <!--识别正确跳过-->
32 34
     <update id="correctSkip">
33 35
         UPDATE e_paper_student0608 ps LEFT JOIN e_paper_student ps2 ON ps.epsid=ps2.epsid
34
-        SET ps.verified=1,ps2.verified=1 WHERE ps.epsid=#{epsid}
36
+        SET ps.verified=1,ps.samed=1,ps2.verified=1 WHERE ps.epsid=#{epsid}
35 37
     </update>
36 38
 </mapper>

+ 2
- 2
src/main/resources/application.properties 파일 보기

@@ -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…
취소
저장