he2802 3 жил өмнө
parent
commit
d788d989c3

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

@@ -74,5 +74,7 @@ public class QuestionChapterVo {
 	@Excel(name = "项目ID")
 	@ApiModelProperty("项目ID")
 	private Long projectId;
+	@ApiModelProperty("试卷数量")
+	private Integer examNum;
 
 }

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

@@ -71,4 +71,6 @@ public class QuestionModuleVo {
 	@Excel(name = "项目ID")
 	@ApiModelProperty("项目ID")
 	private Long projectId;
+	@ApiModelProperty("章卷数量")
+	private Integer chapterExamNum;
 }

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionChapterMapper.xml

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="subjectId" column="subject_id"/>
         <result property="projectId" column="project_id"/>
         <result property="subjectName" column="subject_name"/>
+        <result property="examNum" column="exam_num"/>
         <collection property="goodsList" column="chapter_exam_id" select="findGoodsList"/>
     </resultMap>
 
@@ -61,7 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cet.education_name,
         cpt.project_name,
         cb.business_name,
-        cs.subject_name
+        cs.subject_name,
+        (SELECT COUNT(qce.exam_id) FROM question_chapter_exam qce where qce.chapter_exam_id = qc.chapter_exam_id ) as exam_num
         FROM
         question_chapter qc
         LEFT JOIN question_business qb ON qc.chapter_exam_id = qb.major_id

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionModuleMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="subjectId" column="subject_id"/>
         <result property="projectId" column="project_id"/>
         <result property="subjectName" column="subject_name"/>
+        <result property="chapterExamNum" column="chapter_exam_num"/>
         <collection property="goodsList" column="module_exam_id" select="findGoodsList"/>
     </resultMap>
 
@@ -59,7 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cet.education_name,
         cpt.project_name,
         cb.business_name,
-        cs.subject_name
+        cs.subject_name,
+        (SELECT COUNT(qmc.chapter_exam_id) FROM question_module_chapter qmc where qmc.module_exam_id = qm.module_exam_id ) as chapter_exam_num
         FROM
         question_module qm
         LEFT JOIN question_business qb ON qm.module_exam_id = qb.major_id