<?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.StudentTotalDao">
	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.StudentTotal">
            <result column="user_id_" property="userId" />
	        <result column="exercise_days_" property="exerciseDays" />
	        <result column="exercise_hours_" property="exerciseHours" />
	        <result column="testing_num_" property="testingNum" />
	        <result column="finsh_hours_" property="finshHours" />
	        <result column="unfinsh_hours_" property="unfinshHours" />
	        <result column="star_teacher_num_" property="starTeacherNum" />
	        <result column="update_time_" property="updateTime" />
		</resultMap>  
    
    <!-- 表字段 -->
    <sql id="baseColumns">
         t.user_id_ as userId
        , t.exercise_days_ as exerciseDays
        , t.exercise_hours_ as exerciseHours
        , t.testing_num_ as testingNum
        , t.finsh_hours_ as finshHours
        , t.unfinsh_hours_ as unfinshHours
        , t.star_teacher_num_ as starTeacherNum
        , t.update_time_ as updateTime
        </sql> 
    
    <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.StudentTotalVo">
        SELECT
            <include refid="baseColumns"/>
        FROM student_total t
        where t.user_id_ = #{id}
    </select>
    
    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.StudentTotalVo">
		SELECT         
        	<include refid="baseColumns" />
		FROM student_total t
	</select>
</mapper>