he2802 4 роки тому
батько
коміт
7a9bdb861b

+ 14 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionChapterController.java

@@ -6,8 +6,10 @@ import java.util.Arrays;
 import com.zhongzheng.modules.bank.bo.*;
 import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
+import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.service.IQuestionChapterService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
+import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -45,6 +47,8 @@ public class QuestionChapterController extends BaseController {
 
     private final IQuestionBusinessService iQuestionBusinessService;
 
+    private final IQuestionChapterExamService iQuestionChapterExamService;
+
     /**
      * 查询章卷列表
      */
@@ -124,6 +128,15 @@ public class QuestionChapterController extends BaseController {
         List<QuestionBusiness> list = iQuestionBusinessService.getListById(bo);
         return getDataTable(list);
     }
-
+    /**
+     * 查询关联试卷列表
+     */
+    @ApiOperation("查询关联试卷列表")
+    @PreAuthorize("@ss.hasPermi('system:business:list')")
+    @GetMapping("/exam/list")
+    public AjaxResult<List<ExamVo>> examList(QuestionChapterExamQueryBo bo) {
+        List<ExamVo> list = iQuestionChapterExamService.getList(bo);
+        return AjaxResult.success(list);
+    }
 
 }

+ 2 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionModuleController.java

@@ -131,12 +131,12 @@ public class QuestionModuleController extends BaseController {
     }
 
     /**
-     * 查询题目业务层次关系列表
+     * 查询关联章卷列表
      */
     @ApiOperation("查询关联章卷列表")
     @PreAuthorize("@ss.hasPermi('system:business:list')")
     @GetMapping("/chapter/list")
-    public AjaxResult<List<QuestionChapterVo>> questionList(QuestionModuleChapterQueryBo bo) {
+    public AjaxResult<List<QuestionChapterVo>> chapterList(QuestionModuleChapterQueryBo bo) {
         List<QuestionChapterVo> list = iQuestionModuleChapterService.getList(bo);
         return AjaxResult.success(list);
     }

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/QuestionChapterExamMapper.java

@@ -1,7 +1,13 @@
 package com.zhongzheng.modules.bank.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
+import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
 import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
+import com.zhongzheng.modules.bank.vo.ExamVo;
+import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
+
+import java.util.List;
 
 /**
  * 章试卷关系Mapper接口
@@ -10,5 +16,5 @@ import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
  * @date 2021-10-25
  */
 public interface QuestionChapterExamMapper extends BaseMapper<QuestionChapterExam> {
-
+    List<ExamVo> getList(QuestionChapterExamQueryBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionChapterExamService.java

@@ -5,6 +5,7 @@ import com.zhongzheng.modules.bank.bo.QuestionChapterExamAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
 import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
+import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterExamVo;
 
 import java.util.Collection;
@@ -23,6 +24,8 @@ public interface IQuestionChapterExamService extends IService<QuestionChapterExa
 	 */
 	QuestionChapterExamVo queryById(Long id);
 
+	List<ExamVo> getList(QuestionChapterExamQueryBo bo);
+
 	/**
 	 * 查询列表
 	 */

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterExamServiceImpl.java

@@ -8,8 +8,11 @@ import com.zhongzheng.modules.bank.bo.QuestionChapterExamEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
 import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
 import com.zhongzheng.modules.bank.mapper.QuestionChapterExamMapper;
+import com.zhongzheng.modules.bank.mapper.QuestionModuleChapterMapper;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
+import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterExamVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -31,12 +34,20 @@ import java.util.stream.Collectors;
 @Service
 public class QuestionChapterExamServiceImpl extends ServiceImpl<QuestionChapterExamMapper, QuestionChapterExam> implements IQuestionChapterExamService {
 
+    @Autowired
+    private QuestionChapterExamMapper questionChapterExamMapper;
+
     @Override
     public QuestionChapterExamVo queryById(Long id){
         QuestionChapterExam db = this.baseMapper.selectById(id);
         return BeanUtil.toBean(db, QuestionChapterExamVo.class);
     }
 
+    @Override
+    public List<ExamVo> getList(QuestionChapterExamQueryBo bo) {
+        return questionChapterExamMapper.getList(bo);
+    }
+
     @Override
     public List<QuestionChapterExamVo> queryList(QuestionChapterExamQueryBo bo) {
         LambdaQueryWrapper<QuestionChapterExam> lqw = Wrappers.lambdaQuery();

+ 42 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionChapterExamMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhongzheng.modules.bank.mapper.QuestionChapterExamMapper">
+
+    <resultMap type="com.zhongzheng.modules.bank.domain.QuestionChapterExam" id="QuestionChapterExamResult">
+        <result property="examId" column="exam_id"/>
+        <result property="chapterExamId" column="chapter_exam_id"/>
+        <result property="sort" column="sort"/>
+        <result property="id" column="id"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.bank.vo.ExamVo" id="QuestionChapterExamResultVo">
+        <result property="examId" column="exam_id"/>
+        <result property="status" column="status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="prefixName" column="prefix_name"/>
+        <result property="code" column="code"/>
+        <result property="examName" column="exam_name"/>
+        <result property="publishStatus" column="publish_status"/>
+        <result property="year" column="year"/>
+        <result property="cityId" column="city_id"/>
+        <result property="provinceId" column="province_id"/>
+        <result property="examPaperId" column="exam_paper_id"/>
+        <result property="answerTime" column="answer_time"/>
+        <result property="examPaperId" column="exam_paper_id"/>
+        <result property="answerNum" column="answer_num"/>
+    </resultMap>
+
+    <select id="getList" parameterType="com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo" resultMap="QuestionChapterExamResultVo">
+        SELECT
+            e.*
+        FROM
+            question_chapter_exam qce
+                LEFT JOIN exam e ON qce.exam_id = e.exam_id
+        WHERE
+            qce.chapter_exam_id =#{chapterExamId}
+
+    </select>
+</mapper>