<?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.course.mapper.MajorExamineMapper">

    <resultMap type="com.zhongzheng.modules.course.domain.MajorExamine" id="MajorExamineResult">
        <result property="id" column="id"/>
        <result property="remark" column="remark"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="examineName" column="examine_name"/>
        <result property="status" column="status"/>
        <result property="encoder" column="encoder"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="enrollmentYear" column="enrollment_year"/>
    </resultMap>

    <resultMap type="com.zhongzheng.modules.course.vo.MajorExamineVo" id="MajorExamineResultVo">
        <result property="id" column="id"/>
        <result property="remark" column="remark"/>
        <result property="examineName" column="examine_name"/>
        <result property="status" column="status"/>
        <result property="encoder" column="encoder"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="enrollmentYear" column="enrollment_year"/>
        <result property="educationName" column="education_name"/>
        <result property="projectName" column="project_name"/>
        <result property="educationId" column="education_id"/>
    </resultMap>

    <select id="queryList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo"  resultMap="MajorExamineResultVo">
        SELECT
        b.*,
        e.education_name,
        e.id as education_id,
        p.project_name
        FROM
        major_examine b
        LEFT JOIN course_project_type p on b.project_id =p.id
        LEFT JOIN course_education_type e ON p.education_id = e.id
        where 1=1
        and p.status != -1
        and e.status != -1
        <if test="status != null and status.size()!=0 ">
            AND b.status in
            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>

    </select>
</mapper>
