<?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.business.mapper.ZccmUserVideoPositionMapper">

    <resultMap id="UserVideoPositionMap" type="zccmuserVideoPosition">
        <result property="userVideoPositionId" column="user_video_position_id" jdbcType="INTEGER"/>
        <result property="videoId" column="video_id" jdbcType="INTEGER"/>
        <result property="userId" column="user_id" jdbcType="INTEGER"/>
        <result property="videoPosition" column="video_position" jdbcType="VARCHAR"/>
        <result property="watchEnd" column="watch_end" jdbcType="INTEGER"/>
        <result property="videoTime" column="video_time" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
    user_video_position_id, video_id, user_id, video_position, watch_end, video_time
  </sql>

    <select id="selectUserPositionByUserAndVideo" resultMap="UserVideoPositionMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM zccm_user_video_position
        WHERE video_id = #{videoId,jdbcType=INTEGER}
        AND user_id = #{userId,jdbcType=INTEGER} ORDER BY user_video_position_id DESC
    </select>

</mapper>