<?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.yonge.cooleshow.biz.dal.dao.StudentCourseHomeworkDao">
    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.StudentCourseHomework">
        <result column="id_" property="id" />
        <result column="course_homework_id_" property="courseHomeworkId" />
        <result column="course_group_type_" property="courseGroupType" />
        <result column="course_group_id_" property="courseGroupId" />
        <result column="course_schedule_id_" property="courseScheduleId" />
        <result column="student_id_" property="studentId" />
        <result column="attachments_" property="attachments" />
        <result column="teacher_replied_" property="teacherReplied" />
        <result column="submit_time_" property="submitTime" />
        <result column="create_time_" property="createTime" />
        <result column="update_time_" property="updateTime" />
    </resultMap>

    <!-- 表字段 -->
    <sql id="baseColumns">
         t.id_ as id
        , t.course_homework_id_ as courseHomeworkId
        , t.course_group_type_ as courseGroupType
        , t.course_group_id_ as courseGroupId
        , t.course_schedule_id_ as courseScheduleId
        , t.student_id_ as studentId
        , t.attachments_ as attachments
        , t.teacher_replied_ as teacherReplied
        , t.submit_time_ as submitTime
        , t.create_time_ as createTime
        , t.update_time_ as updateTime
        </sql>

    <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.StudentCourseHomeworkVo">
        SELECT
        <include refid="baseColumns"/>
        FROM student_course_homework t
        where t.id_ = #{id}
    </select>

    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.StudentCourseHomeworkVo">
        SELECT
        <include refid="baseColumns" />
        FROM student_course_homework t
    </select>
</mapper>