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

	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate">
	     <id column="id_" jdbcType="BIGINT" property="id" />
		 <result column="video_id_" jdbcType="BIGINT" property="videoId" />
		 <result column="student_id_" jdbcType="BIGINT" property="studentId" />
		 <result column="content_" jdbcType="VARCHAR" property="content" />
		 <result column="evaluate_time_" jdbcType="TIMESTAMP" property="evaluateTime" />
	</resultMap>

	<sql id="Base_Column_List">
		id_, video_id_, student_id_, content_, evaluate_time_
	</sql>
    <select id="selectEvaluate" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo"
            parameterType="com.baomidou.mybatisplus.core.metadata.IPage">
		SELECT
			u.id_ AS userId,
			u.username_ AS userName,
			u.real_name_ AS realName,
			u.avatar_ AS avatar,
			e.is_teacher_ AS isTeacher,
			e.id_	AS evaluateId,
			e.content_ AS content,
			e.evaluate_time_ AS evaluateTime
		FROM video_lesson_evaluate e
				 LEFT JOIN sys_user u ON e.student_id_ = u.id_
		WHERE video_id_ = #{param.videoId}
	</select>
</mapper>