瀏覽代碼

fix 分销

he2802 2 年之前
父節點
當前提交
515260500c

+ 10 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonBankController.java

@@ -99,4 +99,14 @@ public class CommonBankController extends BaseController {
         List<ExamQuestionVo> list = iExamQuestionService.getAppList(bo);
         return AjaxResult.success(list);
     }
+
+    /**
+     * 查询随机练习试卷题目列表
+     */
+    @ApiOperation("查询随机练习试卷题目列表")
+    @GetMapping("/question/temp/list")
+    public AjaxResult<List<ExamQuestionVo>> questionTempList(ExamQuestionQueryBo bo) {
+        List<ExamQuestionVo> list = iExamQuestionService.getAppTempList(bo);
+        return AjaxResult.success(list);
+    }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamQuestionService.java

@@ -32,6 +32,8 @@ public interface IExamQuestionService extends IService<ExamQuestion> {
 
 	List<ExamQuestionVo> getAppList(ExamQuestionQueryBo bo);
 
+	List<ExamQuestionVo> getAppTempList(ExamQuestionQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入试卷题目关系
 	 * @param bo 试卷题目关系新增业务对象

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamQuestionServiceImpl.java

@@ -59,6 +59,11 @@ public class ExamQuestionServiceImpl extends ServiceImpl<ExamQuestionMapper, Exa
         return examQuestionMapper.getAppList(bo);
     }
 
+    @Override
+    public List<ExamQuestionVo> getAppTempList(ExamQuestionQueryBo bo) {
+        return examQuestionMapper.getAppList(bo);
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 16 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamQuestionMapper.xml

@@ -138,5 +138,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
 
+    <select id="getAppTempList" parameterType="com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo" resultMap="ExamQuestionResultAppVo">
+        SELECT
+            q.*,
+            eq.sort
+        FROM
+            exam_temp_question eq
+                LEFT JOIN question q ON eq.question_id = q.question_id
+                LEFT JOIN exam_temp e ON e.exam_id = eq.exam_id
+        WHERE
+            eq.exam_id =#{examId}
+        ORDER BY
+            eq.sort,
+            eq.id DESC
+
+    </select>
+
 
 </mapper>