yangdamao vor 2 Jahren
Ursprung
Commit
2185a34ea1

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/mapper/CollectQuestionMapper.java

@@ -23,4 +23,6 @@ public interface CollectQuestionMapper extends BaseMapper<CollectQuestion> {
     List<QuestionVo> selectExamQuestionList(CollectQuestionQueryBo bo);
 
     List<CollectQuestionVo> selectTypeNum(CollectQuestionQueryBo bo);
+
+    List<CollectQuestionVo> selectSpecialExam(CollectQuestionQueryBo bo);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/service/impl/CollectQuestionServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.collect.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.bank.vo.QuestionVo;
@@ -74,6 +75,10 @@ public class CollectQuestionServiceImpl extends ServiceImpl<CollectQuestionMappe
 
     @Override
     public List<CollectQuestionVo> selectExamList(CollectQuestionQueryBo bo) {
+        if (ObjectUtils.isNotNull(bo.getDoMode()) && bo.getDoMode() == 4){
+            //山东题库
+            return collectQuestionMapper.selectSpecialExam(bo);
+        }
         return collectQuestionMapper.selectExamList(bo);
     }
 

+ 38 - 0
zhongzheng-system/src/main/resources/mapper/modules/collect/CollectQuestionMapper.xml

@@ -174,6 +174,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
 
+
+    <select id="selectSpecialExam" parameterType="com.zhongzheng.modules.collect.bo.CollectQuestionQueryBo"  resultMap="CollectQuestionVoResult">
+        SELECT
+        e.exam_id,
+        e.exam_name,
+        e.create_time,
+        COUNT( cq.question_id ) question_num,
+        4 AS do_mode
+        FROM
+        collect_question cq
+        LEFT JOIN exam e ON cq.exam_id = e.exam_id
+        LEFT JOIN exam_paper ep ON ep.paper_id = e.exam_paper_id
+        LEFT JOIN goods g ON g.goods_id = cq.goods_id
+        WHERE
+        1 = 1
+        AND cq.do_mode = #{doMode}
+        AND cq.user_id = #{userId}
+        <if test="paperId != null and paperId != ''">
+            AND e.exam_paper_id = #{paperId}
+        </if>
+        <if test="goodsId != null and goodsId != ''">
+            AND cq.goods_id = #{goodsId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND cq.order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        GROUP BY
+        e.exam_id
+        ORDER BY
+        e.create_time desc
+    </select>
+
     <select id="selectExamQuestionList" parameterType="com.zhongzheng.modules.collect.bo.CollectQuestionQueryBo"  resultMap="QuestionResultVo">
         SELECT
             DISTINCT q.*,