he2802 2 年之前
父節點
當前提交
1c661f98e8

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamSimulateQueryBo.java

@@ -77,5 +77,5 @@ public class ExamSimulateQueryBo extends BaseEntity {
 
 	/** 1题库商品 2视频商品 3模考商品 */
 	@ApiModelProperty("1题库商品 2视频商品 3模考商品")
-	private Integer from;
+	private Integer fromType;
 }

+ 6 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamSimulateServiceImpl.java

@@ -109,7 +109,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         qk1Bo.setKnum(simulateConfig.getSingleChoice().getKnum());
         qk1Bo.setRandomNum(simulateConfig.getType());
         qk1Bo.setType(1);
-        qk1Bo.setFrom(bo.getFrom());
+        qk1Bo.setFromType(bo.getFrom());
         List<Long> qk1 = baseMapper.getKnowledQuestionList(qk1Bo);
 
         ExamSimulateQueryBo qk2Bo = new ExamSimulateQueryBo(); //多选知识点
@@ -118,7 +118,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         qk2Bo.setKnum(simulateConfig.getMultipleChoice().getKnum());
         qk2Bo.setRandomNum(simulateConfig.getType());
         qk2Bo.setType(2);
-        qk2Bo.setFrom(bo.getFrom());
+        qk2Bo.setFromType(bo.getFrom());
         List<Long> qk2 = baseMapper.getKnowledQuestionList(qk2Bo);
 
         ExamSimulateQueryBo qk3Bo = new ExamSimulateQueryBo(); //案例选知识点
@@ -127,7 +127,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         qk3Bo.setKnum(simulateConfig.getCaseQuestion().getKnum());
         qk3Bo.setRandomNum(simulateConfig.getType());
         qk3Bo.setType(4);
-        qk3Bo.setFrom(bo.getFrom());
+        qk3Bo.setFromType(bo.getFrom());
         List<Long> qk3 = baseMapper.getKnowledQuestionList(qk3Bo);
 
         ExamSimulateQueryBo q1Bo = new ExamSimulateQueryBo();  //单选
@@ -136,7 +136,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         q1Bo.setQnum(simulateConfig.getSingleChoice().getQnum()-qk1.size());
         q1Bo.setRandomNum(simulateConfig.getType());
         q1Bo.setType(1);
-        q1Bo.setFrom(bo.getFrom());
+        q1Bo.setFromType(bo.getFrom());
         List<Long> q1 = baseMapper.getQuestionList(q1Bo);
 
         ExamSimulateQueryBo q2Bo = new ExamSimulateQueryBo();  //多选
@@ -145,7 +145,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         q2Bo.setQnum(simulateConfig.getMultipleChoice().getQnum()-qk2.size());
         q2Bo.setRandomNum(simulateConfig.getType());
         q2Bo.setType(2);
-        q2Bo.setFrom(bo.getFrom());
+        q2Bo.setFromType(bo.getFrom());
         List<Long> q2 = baseMapper.getQuestionList(q2Bo);
 
         ExamSimulateQueryBo q3Bo = new ExamSimulateQueryBo();  //案例选
@@ -154,7 +154,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         q3Bo.setQnum(simulateConfig.getCaseQuestion().getQnum()-qk3.size());
         q3Bo.setRandomNum(simulateConfig.getType());
         q3Bo.setType(4);
-        q3Bo.setFrom(bo.getFrom());
+        q3Bo.setFromType(bo.getFrom());
         List<Long> q3 = baseMapper.getQuestionList(q3Bo);
 
         qk1.addAll(q1);

+ 36 - 3
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamSimulateMapper.xml

@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN question q ON eq.question_id = q.question_id
         WHERE
             eq.exam_id = #{examId}
-        <if test="from != null and from == 1">
+        <if test="fromType != null and fromType == 1">
             AND NOT FIND_IN_SET(
             q.question_id,(
             SELECT
@@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             order_goods_id = #{orderGoodsId} and exam_id = #{examId} and do_mode = 3
             ))
         </if>
-        <if test="from != null and from == 2">
+        <if test="fromType != null and fromType == 2">
             AND NOT FIND_IN_SET(
             q.question_id,(
             SELECT
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             order_goods_id = #{orderGoodsId} and exam_id = #{examId} and do_mode = 3
             ))
         </if>
-        <if test="from != null and from == 3">
+        <if test="fromType != null and fromType == 3">
             AND NOT FIND_IN_SET(
             q.question_id,(
             SELECT
@@ -101,6 +101,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN question q ON eq.question_id = q.question_id
         WHERE
         eq.exam_id = #{examId}
+        <if test="fromType != null and fromType == 1">
+            AND NOT FIND_IN_SET(
+            q.question_id,(
+            SELECT
+            IFNULL(GROUP_CONCAT( right_question_ids ),'')
+            FROM
+            user_exam_record uer
+            WHERE
+            order_goods_id = #{orderGoodsId} and exam_id = #{examId} and do_mode = 3
+            ))
+        </if>
+        <if test="fromType != null and fromType == 2">
+            AND NOT FIND_IN_SET(
+            q.question_id,(
+            SELECT
+            IFNULL(GROUP_CONCAT( right_question_ids ),'')
+            FROM
+            user_bank_record uer
+            WHERE
+            order_goods_id = #{orderGoodsId} and exam_id = #{examId} and do_mode = 3
+            ))
+        </if>
+        <if test="fromType != null and fromType == 3">
+            AND NOT FIND_IN_SET(
+            q.question_id,(
+            SELECT
+            IFNULL(GROUP_CONCAT( right_question_ids ),'')
+            FROM
+            user_mock_record uer
+            WHERE
+            order_goods_id = #{orderGoodsId} and exam_id = #{examId} and do_mode = 3
+            ))
+        </if>
         <if test="type != null and type != ''">
             AND q.`type` = #{type}
         </if>