Forráskód Böngészése

知识点基础参数业务

change 4 éve
szülő
commit
58b6125b3c

+ 36 - 3
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamKnowledgeMapper.xml

@@ -49,15 +49,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
 
         <if test="educationId != null and educationId !=0 ">
-            AND q.education_id = #{educationId}
+            AND #{educationId} in (
+            SELECT
+            e.id AS education_id
+            FROM
+            exam_knowledge_business b
+            LEFT JOIN course_business s ON s.id = b.business_id
+            LEFT JOIN course_subject j ON j.id = b.subject_id
+            LEFT JOIN course_project_type p ON s.project_id = p.id
+            LEFT JOIN course_education_type e ON p.education_id = e.id
+            WHERE
+            b.knowledge_id = k.knowledge_id
+            )
         </if>
 
         <if test="subjectId != null and subjectId !=0 ">
-            AND q.subject_id = #{subjectId}
+            AND #{subjectId} in (
+            SELECT
+            b.subject_id
+            FROM
+            exam_knowledge_business b
+            LEFT JOIN course_business s ON s.id = b.business_id
+            LEFT JOIN course_subject j ON j.id = b.subject_id
+            LEFT JOIN course_project_type p ON s.project_id = p.id
+            LEFT JOIN course_education_type e ON p.education_id = e.id
+            WHERE
+            b.knowledge_id = k.knowledge_id
+            )
         </if>
 
         <if test="businessId != null and businessId !=0 ">
-            AND q.business_id = #{businessId}
+            AND #{businessId} in (
+            SELECT
+            b.business_id
+            FROM
+            exam_knowledge_business b
+            LEFT JOIN course_business s ON s.id = b.business_id
+            LEFT JOIN course_subject j ON j.id = b.subject_id
+            LEFT JOIN course_project_type p ON s.project_id = p.id
+            LEFT JOIN course_education_type e ON p.education_id = e.id
+            WHERE
+            b.knowledge_id = k.knowledge_id
+            )
         </if>
 
         <if test="knowledgeName != null and knowledgeName !=0 ">