|
@@ -34,10 +34,40 @@
|
|
|
<result property="knowledgeIds" column="knowledge_ids"/>
|
|
|
<result property="publishStatus" column="publish_status"/>
|
|
|
<result property="code" column="code"/>
|
|
|
- <collection property="businessList" javaType="java.util.List" resultMap="QuestionBusiness"/>
|
|
|
- <collection property="knowledgeList" javaType="java.util.List" resultMap="ExamKnowledge"/>
|
|
|
+ <collection property="businessList" column="question_id" select="findBusinessList" />
|
|
|
+ <collection property="knowledgeList" column="knowledge_ids" select="findKnowledge"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <select id="findKnowledge" resultMap="ExamKnowledge">
|
|
|
+ SELECT
|
|
|
+ ek.knowledge_name,
|
|
|
+ ek.knowledge_id
|
|
|
+ FROM
|
|
|
+ exam_knowledge ek
|
|
|
+ WHERE
|
|
|
+ FIND_IN_SET( ek.knowledge_id, #{knowledge_ids} )
|
|
|
+ </select>
|
|
|
+ <select id="findBusinessList" resultMap="QuestionBusiness">
|
|
|
+ SELECT
|
|
|
+ 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
|
|
|
+ FROM
|
|
|
+ question_business qb
|
|
|
+ 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
|
|
|
+ WHERE
|
|
|
+ qb.major_id=#{question_id} and qb.type = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
<resultMap type="com.zhongzheng.modules.bank.domain.QuestionBusiness" id="QuestionBusiness">
|
|
|
<result property="id" column="id"/>
|
|
|
<result property="subjectId" column="subject_id"/>
|
|
@@ -58,21 +88,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectList" parameterType="com.zhongzheng.modules.bank.bo.QuestionQueryBo" resultMap="QuestionResultVo">
|
|
|
- SELECT
|
|
|
- q.*,
|
|
|
- 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,
|
|
|
- ek.knowledge_name,
|
|
|
- ek.knowledge_id
|
|
|
- FROM
|
|
|
- (SELECT DISTINCT
|
|
|
+ SELECT DISTINCT
|
|
|
q.*
|
|
|
FROM
|
|
|
question q
|
|
@@ -102,27 +118,10 @@
|
|
|
<if test="pageSizeSelf != null and pageSizeSelf != ''">
|
|
|
LIMIT #{currIndex} , #{pageSizeSelf}
|
|
|
</if>
|
|
|
- )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_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_knowledge ek ON FIND_IN_SET( ek.knowledge_id, q.knowledge_ids )
|
|
|
- WHERE
|
|
|
- 1 = 1
|
|
|
- <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>
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectListCount" resultType="Long">
|
|
|
+ <select id="selectList_COUNT" resultType="Long">
|
|
|
SELECT
|
|
|
count(distinct q.question_id)
|
|
|
FROM
|