he2802 %!s(int64=2) %!d(string=hai) anos
pai
achega
f402abbbe7

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserExamRecordMapper.java

@@ -39,4 +39,6 @@ public interface UserExamRecordMapper extends BaseMapper<UserExamRecord> {
     UserExamRecordVo getUserDoLast(UserExamRecordQueryBo bo);
 
     Long checkBatchUserExamRecord(CheckUserExamRecordBo bo);
+
+    List<UserExamRecordVo> selectSpecialGroup(UserExamRecordQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserExamWrongRecordMapper.java

@@ -22,4 +22,6 @@ public interface UserExamWrongRecordMapper extends BaseMapper<UserExamWrongRecor
     List<UserExamWrongRecordVo> selectTypeNum(UserExamWrongRecordQueryBo bo);
     List<UserExamWrongRecordVo> selectTypeQuestionList(UserExamWrongRecordQueryBo bo);
     Long recordNum(UserExamWrongRecordQueryBo bo);
+
+    List<UserExamWrongRecordVo> selectSpecialList(UserExamWrongRecordQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamRecordServiceImpl.java

@@ -250,6 +250,10 @@ public class UserExamRecordServiceImpl extends ServiceImpl<UserExamRecordMapper,
 
     @Override
     public List<UserExamRecordVo> selectGroupList(UserExamRecordQueryBo bo) {
+        if (ObjectUtils.isNotNull(bo.getDoMode()) && bo.getDoMode() == 4){
+            //山东题库记录
+            return baseMapper.selectSpecialGroup(bo);
+        }
         return this.baseMapper.selectGroupList(bo);
     }
 

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamWrongRecordServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.user.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;
@@ -64,6 +65,10 @@ public class UserExamWrongRecordServiceImpl extends ServiceImpl<UserExamWrongRec
 
     @Override
     public List<UserExamWrongRecordVo> selectList(UserExamWrongRecordQueryBo bo) {
+        if (ObjectUtils.isNotNull(bo.getDoMode()) && bo.getDoMode() == 4){
+            //山东题库
+            return userExamWrongRecordMapper.selectSpecialList(bo);
+        }
         return userExamWrongRecordMapper.selectList(bo);
     }
 

+ 58 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -389,6 +389,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         -- ORDER by ue.record_id DESC
     </select>
 
+
+    <select id="selectSpecialGroup" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultType="com.zhongzheng.modules.user.vo.UserExamRecordVo">
+        SELECT * FROM (
+        SELECT
+        ue.record_id ,ue.user_id ,ue.exam_id ,1 AS courseType,null as type,ue.`status`,ue.goods_id
+        ,ue.report_status,ue.performance,ue.history_exam_json,
+        ue.update_time,ue.total_question_num,ue.right_question_num,ue.do_question_num,ue.module_exam_id as moduleExamId,
+        ue.chapter_exam_id as chapterExamId,NULL as courseId,NULL as moduleId,NULL as chapterId,NULL as sectionId,NULL
+        as gradeId,
+        ue.do_time,ue.exam_time,ue.total_score,ue.do_question_ids,ue.right_question_ids,ue.score,ue.all_question_num,ue.order_goods_id,
+        ue.less_question_num,ue.create_time,e.exam_name,ep.paper_name,4 AS do_mode
+        FROM
+        (
+        SELECT
+        ue.goods_id,
+        ue.exam_id,
+        ue.module_exam_id,
+        ue.chapter_exam_id,
+        MAX( UE.record_id ) record_id
+        FROM
+        user_exam_record ue
+        LEFT JOIN exam e ON ue.exam_id = e.exam_id
+        LEFT JOIN exam_paper ep ON e.exam_paper_id = ep.paper_id
+        WHERE
+        ue.user_id = #{userId}
+        GROUP BY
+        ue.goods_id,
+        ue.exam_id,
+        ue.module_exam_id,
+        ue.chapter_exam_id
+        ) t
+        LEFT JOIN user_exam_record ue ON t.record_id = ue.record_id
+        LEFT JOIN exam e ON ue.exam_id = e.exam_id
+        LEFT JOIN exam_paper ep ON e.exam_paper_id = ep.paper_id
+        LEFT JOIN goods g ON g.goods_id = ue.goods_id
+        WHERE
+        ue.user_id = #{userId}
+        AND ue.do_mode = #{doMode}
+        <if test="paperId != null and paperId != ''">
+            AND ep.paper_id = #{paperId}
+        </if>
+        <if test="goodsId != null and goodsId != ''">
+            AND ue.goods_id = #{goodsId}
+        </if>
+        <if test="examId != null and examId != ''">
+            AND ue.exam_id = #{examId}
+        </if>
+        <if test="moduleExamId != null and moduleExamId != ''">
+            AND ue.module_exam_id = #{moduleExamId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND ue.order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="chapterExamId != null and chapterExamId != ''">
+            AND ue.chapter_exam_id = #{chapterExamId}</if>
+        ) a ORDER by a.create_time DESC
+    </select>
+
 <!--    <select id="selectGroupList" parameterType="com.zhongzheng.modules.user.bo.UserExamRecordQueryBo" resultMap="UserExamRecordVoResult">-->
 <!--        SELECT-->
 <!--        ue.*,-->

+ 33 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamWrongRecordMapper.xml

@@ -147,6 +147,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         e.exam_id
     </select>
 
+    <select id="selectSpecialList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="UserExamWrongRecordVoResult">
+        SELECT
+        e.exam_name,
+        e.exam_id,
+        COUNT( DISTINCT uew.question_id ) AS wrong_question_num,
+        4 AS do_mode
+        FROM
+        user_exam_wrong_record uew
+        LEFT JOIN exam e ON uew.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 = uew.goods_id
+        WHERE
+        uew.user_id = #{userId}
+        AND uew.do_mode = #{doMode}
+        <if test="goodsId != null and goodsId != ''">
+            AND uew.goods_id = #{goodsId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND uew.order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="paperId != null and paperId != ''">
+            AND e.exam_paper_id = #{paperId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        GROUP BY
+        e.exam_id
+    </select>
+
     <select id="selectQuestionList" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo" resultMap="UserExamWrongRecordVoResult">
         SELECT DISTINCT
         q.*,