Browse Source

跳过

ywx
雍文秀 6 months ago
parent
commit
003ac8f7c6

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

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

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

2
 
2
 
3
 import com.xhkjedu.model.EPaperStudent0608;
3
 import com.xhkjedu.model.EPaperStudent0608;
4
 import org.apache.ibatis.annotations.Param;
4
 import org.apache.ibatis.annotations.Param;
5
+import org.springframework.stereotype.Repository;
5
 
6
 
6
 import java.util.List;
7
 import java.util.List;
7
 import java.util.Map;
8
 import java.util.Map;
12
  * @description todo
13
  * @description todo
13
  * @date 2024/6/8 14:44
14
  * @date 2024/6/8 14:44
14
  **/
15
  **/
16
+@Repository
15
 public interface EPaperVerifyMapper {
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
     Map getStudentPaper(@Param("ps") EPaperStudent0608 ps);
22
     Map getStudentPaper(@Param("ps") EPaperStudent0608 ps);

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

20
     private EPaperVerifyMapper ePaperVerifyMapper;
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
         from e_class_student s left join e_class c on s.examid=c.examid and c.classid=c.classid
7
         from e_class_student s left join e_class c on s.examid=c.examid and c.classid=c.classid
8
         LEFT JOIN t_user u on s.studentid=u.userid
8
         LEFT JOIN t_user u on s.studentid=u.userid
9
         left join e_base e on c.examid=e.examid
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
     </select>
13
     </select>
12
 
14
 
13
     <!--获取学生试卷及试题作答-->
15
     <!--获取学生试卷及试题作答-->
31
     <!--识别正确跳过-->
33
     <!--识别正确跳过-->
32
     <update id="correctSkip">
34
     <update id="correctSkip">
33
         UPDATE e_paper_student0608 ps LEFT JOIN e_paper_student ps2 ON ps.epsid=ps2.epsid
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
     </update>
37
     </update>
36
 </mapper>
38
 </mapper>

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

22
 # \u6D4B\u8BD5\u8FDE\u63A5\u662F\u5426\u53EF\u7528\u7684query \u8BED\u53E5 \u5728oracle\u662F select 1 from dual  36   28.26
22
 # \u6D4B\u8BD5\u8FDE\u63A5\u662F\u5426\u53EF\u7528\u7684query \u8BED\u53E5 \u5728oracle\u662F select 1 from dual  36   28.26
23
 spring.datasource.hikari.connection-test-query=SELECT 1
23
 spring.datasource.hikari.connection-test-query=SELECT 1
24
 # \u6240\u6709Entity\u522B\u540D\u7C7B\u6240\u5728\u5305
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
 mybatis.configuration.call-setters-on-nulls=true
27
 mybatis.configuration.call-setters-on-nulls=true
28
 mapper.mappers=com.xhkjedu.base.TkMapper
28
 mapper.mappers=com.xhkjedu.base.TkMapper
29
 mapper.identity=MYSQL
29
 mapper.identity=MYSQL

Loading…
Cancel
Save