فهرست منبع

fix 题库模块

he2802 4 سال پیش
والد
کامیت
f29a78f0d9

+ 5 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java

@@ -57,7 +57,11 @@ public class QuestionController extends BaseController {
     public TableDataInfo<QuestionVo> list(QuestionQueryBo bo) {
         startPage();
         List<QuestionVo> list = iQuestionService.selectList(bo);
-        return getDataTable(list);
+        TableDataInfo<QuestionVo> result = getDataTable(list);
+        /*if(list.size()>0){
+            result.setTotal(list.get(0).getTotal());
+        }*/
+        return result;
     }
 
     /**

+ 0 - 1
zhongzheng-admin/src/main/resources/application.yml

@@ -137,7 +137,6 @@ mybatis-plus:
   # 指定外部化 MyBatis Properties 配置,通过该配置可以抽离配置,实现不同环境的配置部署
   configurationProperties: null
   configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     # 自动驼峰命名规则(camel case)映射
     # 如果您的数据库命名符合规则无需使用 @TableField 注解指定数据库字段名
     mapUnderscoreToCamelCase: true

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionVo.java

@@ -95,4 +95,6 @@ public class QuestionVo {
 	/** 知识点列表 */
 	@ApiModelProperty("知识点列表")
 	private List<ExamKnowledge> knowledgeList;
+
+	private Integer total;
 }

+ 35 - 2
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zhongzheng.modules.bank.mapper.QuestionMapper">
 
     <resultMap type="com.zhongzheng.modules.bank.domain.Question" id="QuestionResult">
@@ -96,4 +96,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
 
     </select>
+
+    <select id="selectList_COUNT" resultType="Long">
+        SELECT
+        count(distinct q.question_id)
+        FROM
+        question q
+        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_business cb ON qb.business_id = cb.id
+        LEFT JOIN course_subject cs ON cs.id = qb.subject_id
+        WHERE
+        1 = 1
+        <if test="status != null and status.size()!=0 ">
+            AND q.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND qb.education_type_id = #{educationTypeId}
+        </if>
+        <if test="subjectId != null and subjectId != ''">
+            AND qb.subject_id = #{subjectId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND qb.business_id = #{businessId}
+        </if>
+        <if test="prefixName != null and prefixName != ''">
+            AND q.prefix_name like concat('%', #{prefixName}, '%')
+        </if>
+
+    </select>
 </mapper>