he2802 %!s(int64=4) %!d(string=hai) anos
pai
achega
4a94328bfb

+ 2 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/ExamController.java

@@ -50,4 +50,6 @@ public class ExamController extends BaseController {
         return AjaxResult.success(iExamService.queryById(examId));
     }
 
+
+
 }

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

@@ -96,7 +96,7 @@ public class CommonBankController extends BaseController {
     @ApiOperation("查询试卷题目列表")
     @GetMapping("/question/list")
     public AjaxResult<List<ExamQuestionVo>> questionList(ExamQuestionQueryBo bo) {
-        List<ExamQuestionVo> list = iExamQuestionService.getList(bo);
+        List<ExamQuestionVo> list = iExamQuestionService.getAppList(bo);
         return AjaxResult.success(list);
     }
 }

+ 1 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -93,7 +93,7 @@ public class GoodsController extends BaseController {
         UserExamWrongRecordQueryBo wBo = new UserExamWrongRecordQueryBo();
         wBo.setGoodsId(goodsId);
         wBo.setUserId(loginUser.getUser().getUserId());
-        Integer wrongNum = iUserExamWrongRecordService.recordNum(wBo);
+        Long wrongNum = iUserExamWrongRecordService.recordNum(wBo);
         numMap.put("wrongNum",wrongNum);
 
         CollectQuestionQueryBo collectQuestionQueryBo = new CollectQuestionQueryBo();

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamQuestionMapper.java

@@ -17,4 +17,5 @@ import java.util.List;
  */
 public interface ExamQuestionMapper extends BaseMapper<ExamQuestion> {
     List<ExamQuestionVo> getList(ExamQuestionQueryBo bo);
+    List<ExamQuestionVo> getAppList(ExamQuestionQueryBo bo);
 }

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

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

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

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

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

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

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserExamWrongRecordService.java

@@ -26,7 +26,7 @@ public interface IUserExamWrongRecordService extends IService<UserExamWrongRecor
 	 */
 	UserExamWrongRecordVo queryById(Long wrongId);
 
-	Integer recordNum(UserExamWrongRecordQueryBo bo);
+	Long recordNum(UserExamWrongRecordQueryBo bo);
 
 	/**
 	 * 查询列表

+ 2 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamWrongRecordServiceImpl.java

@@ -44,14 +44,8 @@ public class UserExamWrongRecordServiceImpl extends ServiceImpl<UserExamWrongRec
     }
 
     @Override
-    public Integer recordNum(UserExamWrongRecordQueryBo bo) {
-        LambdaQueryWrapper<UserExamWrongRecord> lqw = Wrappers.lambdaQuery();
-        lqw.eq(bo.getRecordId() != null, UserExamWrongRecord::getRecordId, bo.getRecordId());
-        lqw.eq(bo.getQuestionId() != null, UserExamWrongRecord::getQuestionId, bo.getQuestionId());
-        lqw.eq(bo.getUserId() != null, UserExamWrongRecord::getUserId, bo.getUserId());
-        lqw.eq(bo.getGoodsId() != null, UserExamWrongRecord::getGoodsId, bo.getGoodsId());
-        lqw.eq(bo.getExamId() != null, UserExamWrongRecord::getExamId, bo.getExamId());
-        return this.count(lqw);
+    public Long recordNum(UserExamWrongRecordQueryBo bo) {
+        return this.recordNum(bo);
     }
 
     @Override

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

@@ -38,6 +38,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <collection property="knowledgeList" javaType="java.util.List" resultMap="ExamKnowledge"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.bank.vo.ExamQuestionVo" id="ExamQuestionResultAppVo">
+        <result property="id" column="id"/>
+        <result property="examId" column="exam_id"/>
+        <result property="questionId" column="question_id"/>
+        <result property="sort" column="sort"/>
+        <result property="score" column="score"/>
+        <result property="partScore" column="part_score"/>
+        <result property="content" column="content"/>
+        <result property="type" column="type"/>
+        <result property="answerQuestion" column="answer_question"/>
+        <result property="status" column="status"/>
+        <result property="analysisContent" column="analysis_content"/>
+        <result property="imgUrl" column="img_url"/>
+        <result property="jsonStr" column="json_str"/>
+        <result property="prefixName" column="prefix_name"/>
+        <result property="knowledgeIds" column="knowledge_ids"/>
+        <result property="publishStatus" column="publish_status"/>
+        <result property="code" column="code"/>
+        <result property="answerTime" column="answer_time"/>
+        <result property="examPaperId" column="exam_paper_id"/>
+        <result property="answerNum" column="answer_num"/>
+    </resultMap>
+
     <resultMap type="com.zhongzheng.modules.bank.domain.QuestionBusiness" id="QuestionBusiness">
         <result property="id" column="id"/>
         <result property="subjectId" column="subject_id"/>
@@ -93,4 +116,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     </select>
+
+    <select id="getAppList" parameterType="com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo" resultMap="ExamQuestionResultAppVo">
+        SELECT
+            q.*,
+            eq.part_score,
+            eq.score,
+            eq.sort,
+            qb.education_type_id,
+            qb.business_id,
+            qb.project_id,
+            qb.subject_id,
+            qb.type as business_type,
+            cet.education_name,
+            cpt.project_name,
+            cb.business_name,
+            cs.subject_name,
+            e.pass_score,
+            e.answer_time,
+            e.answer_num
+        FROM
+            exam_question eq
+                LEFT JOIN question q ON eq.question_id = q.question_id
+                LEFT JOIN question_business qb ON q.question_id = qb.major_id and qb.type = 1
+                LEFT JOIN course_education_type cet ON qb.education_type_id = cet.id
+                LEFT JOIN course_project_type cpt ON qb.project_id = cpt.id
+                LEFT JOIN course_business cb ON qb.business_id = cb.id
+                LEFT JOIN course_subject cs ON cs.id = qb.subject_id
+                LEFT JOIN exam e ON e.exam_id = eq.exam_id
+        WHERE
+            eq.exam_id =#{examId}
+        ORDER BY eq.sort,eq.id DESC
+
+    </select>
 </mapper>

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

@@ -127,4 +127,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND uew.goods_id = #{goodsId}
         </if>
     </select>
+
+    <select id="recordNum" parameterType="com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo"  resultType="Long">
+        SELECT
+        count( DISTINCT question_id )
+        FROM
+        user_exam_wrong_record
+        WHERE
+        goods_id = #{goodsId}
+        AND user_id = #{userId}
+
+    </select>
 </mapper>