| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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">
- <mapper namespace="com.zhongzheng.modules.exam.mapper.ExamKnowledgeMapper">
- <resultMap type="com.zhongzheng.modules.exam.domain.ExamKnowledge" id="ExamKnowledgeResult">
- <result property="knowledgeId" column="knowledge_id"/>
- <result property="knowledgeName" column="knowledge_name"/>
- <result property="status" column="status"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="encoder" column="encoder"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.exam.vo.ExamKnowledgeVo" id="ExamKnowledgeVoResult">
- <result property="knowledgeId" column="knowledge_id"/>
- <result property="knowledgeName" column="knowledge_name"/>
- <result property="status" column="status"/>
- <result property="encoder" column="encoder"/>
- <association property="courseBusinessList" javaType="java.util.List" resultMap="CourseBusinessVoResult" />
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseBusinessVo" id="CourseBusinessVoResult">
- <result property="businessName" column="business_name"/>
- <result property="businessId" column="business_id"/>
- <result property="subjectId" column="subject_id"/>
- <result property="remark" column="remark"/>
- <result property="projectId" column="project_id"/>
- <result property="schoolYear" column="school_year"/>
- <result property="status" column="status"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="educationId" column="education_id"/>
- <result property="subjectName" column="subject_name"/>
- </resultMap>
- <select id="queryList" parameterType="com.zhongzheng.modules.exam.bo.ExamKnowledgeQueryBo" resultMap="ExamKnowledgeVoResult">
- SELECT
- k.*,
- q.*
- FROM
- exam_knowledge k
- LEFT JOIN (
- SELECT
- b.knowledge_id as k_id,
- b.business_id,
- b.subject_id,
- s.business_name,
- j.subject_name,
- e.education_name,
- e.id AS education_id,
- p.project_name,
- p.id as project_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
- ) q ON q.k_id = k.knowledge_id
- <if test="status != null and status.size()!=0 ">
- AND k.status in
- <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="educationId != null and educationId !=0 ">
- AND q.education_id = #{educationId}
- </if>
- <if test="courseSubjectId != null and courseSubjectId !=0 ">
- AND q.subject_id = #{courseSubjectId}
- </if>
- <if test="businessId != null and businessId !=0 ">
- AND q.business_id = #{businessId}
- </if>
- <if test="knowledgeName != null and knowledgeName !=0 ">
- AND k.knowledge_name like concat('%', #{knowledgeName}, '%')
- </if>
- </select>
- </mapper>
|