<?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.WebCourseChapterVideoMapper">

    <resultMap type="com.hc.gpbusiness.model.WebCourseChapterVideo" id="CourseChapterVideoMap">
        <result property="videoId" column="video_id" jdbcType="INTEGER"/>
        <result property="courseChapterId" column="course_chapter_id" jdbcType="INTEGER"/>
        <result property="videoName" column="video_name" jdbcType="VARCHAR"/>
        <result property="videoUrl" column="video_url" jdbcType="VARCHAR"/>
        <result property="videoOriUrl" column="video_ori_url" jdbcType="VARCHAR"/>
        <result property="isFree" column="is_free" jdbcType="INTEGER"/>
        <result property="freeTime" column="free_time" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="BIGINT"/>
        <result property="updateTime" column="update_time" jdbcType="BIGINT"/>
    </resultMap>

    <sql id="Base_Column_List">
           video_id,
           course_chapter_id,
           video_name,
           video_url,
           video_ori_url,
           is_free,
           free_time,
           create_time,
           update_time
        </sql>

    <select id="queryByChapterId" resultMap="CourseChapterVideoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM web_course_chapter_video
        WHERE course_chapter_id = #{chapterId}
    </select>

</mapper>