<?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.hc.gpbusiness.mapper.WebCourseChapterMapper">

    <resultMap type="com.hc.gpbusiness.model.WebCourseChapter" id="CourseChapterMap">
        <result property="courseChapterId" column="course_chapter_id" jdbcType="INTEGER"/>
        <result property="chapterName" column="chapter_name" jdbcType="VARCHAR"/>
        <result property="parentId" column="parent_id" jdbcType="INTEGER"/>
        <result property="chapterLevel" column="chapter_level" jdbcType="INTEGER"/>
        <result property="courseId" column="course_id" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="BIGINT"/>
        <result property="updateTime" column="update_time" jdbcType="BIGINT"/>
    </resultMap>

    <sql id="Base_Column_List">
           course_chapter_id,
           chapter_name,
           parent_id,
           chapter_level,
           course_id,
           create_time,
           update_time
    </sql>

    <select id="queryByCourseId" resultMap="CourseChapterMap">
         SELECT
         <include refid="Base_Column_List"/>
         FROM web_course_chapter
         WHERE course_id = #{courseId}
    </select>

</mapper>