Browse Source

fix 题目

he2802 3 years ago
parent
commit
ca192e3fa9

+ 28 - 7
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -166,12 +166,23 @@
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.bank.bo.QuestionQueryBo" resultMap="QuestionResultVo">
-       SELECT DISTINCT
+       SELECT
         q.*
         FROM
         question q
-        LEFT JOIN question_business qb ON q.question_id = qb.major_id
-        AND qb.type = 1
+        LEFT JOIN (SELECT
+        major_id,
+        type,
+        any_value ( education_type_id ),
+        any_value ( business_id ),
+        any_value ( project_id ),
+        any_value ( major_id )
+        FROM
+        question_business
+        where type = 1
+        GROUP BY
+        major_id,
+        type ) qb ON q.question_id = qb.major_id
         WHERE
         1 = 1 AND q.status !=-1
         <if test="status != null and status.size()!=0 ">
@@ -205,17 +216,27 @@
         <if test="pageSizeSelf != null and pageSizeSelf != ''">
             LIMIT #{currIndex} , #{pageSizeSelf}
         </if>
-        GROUP BY
-        q.question_id
         ORDER BY q.question_id DESC
     </select>
 
     <select id="selectList_COUNT" resultType="Long">
         SELECT
-        count(distinct q.question_id)
+        count( q.question_id)
         FROM
         question q
-        LEFT JOIN question_business qb ON q.question_id = qb.major_id and qb.type = 1
+        LEFT JOIN (SELECT
+        major_id,
+        type,
+        any_value ( education_type_id ),
+        any_value ( business_id ),
+        any_value ( project_id ),
+        any_value ( major_id )
+        FROM
+        question_business
+        where type = 1
+        GROUP BY
+        major_id,
+        type ) qb ON q.question_id = qb.major_id
         WHERE
         1 = 1 AND q.status !=-1
         <if test="status != null and status.size()!=0 ">