<?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="org.dromara.system.mapper.CourseTableMapper">
    <resultMap type="org.dromara.system.domain.vo.CourseTableVo" id="CourseTableResult">
        <result property="id"    column="id"    />
        <result property="schoolId"    column="school_id"    />
        <result property="schoolName"    column="school_name"    />
        <result property="classId"    column="class_id"    />
        <result property="className"    column="class_name"    />
        <result property="week"    column="week"    />
        <result property="classNumber"    column="class_number"    />
        <result property="timeFrame"    column="time_frame"    />
        <result property="courseName"    column="course_name"    />
        <result property="courseTeacher"    column="course_teacher"    />

        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectCourseTableVo">
        select id, school_id, school_name, class_id, class_name, week, class_number, time_frame, course_name, course_teacher, create_by, create_time, update_by, update_time, remark from course_table
    </sql>

    <select id="selectCourseTableByClassIdAndWeek" resultMap="CourseTableResult">
        <include refid="selectCourseTableVo"/>
        where class_id = #{classId} and week = #{week}
    </select>
    <select id="selectCourseVoList" resultMap="CourseTableResult">
        <include refid="selectCourseTableVo"/>
        ${ew.getCustomSqlSegment}
    </select>

</mapper>
