<?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="cn.reghao.tnb.content.app.vod.db.mapper.BannerVideoMapper">
    <insert id="save" useGeneratedKeys="true" keyProperty="id">
        insert into vod_banner_video
        (`video_id`,`title`,`cover_url`)
        values
        (#{videoId},#{title},#{coverUrl})
    </insert>
    <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
        insert ignore into vod_banner_video
        (`video_id`,`title`,`cover_url`)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.videoId},#{item.title},#{item.coverUrl})
        </foreach>
    </insert>

    <select id="findBannerVideos" resultType="cn.reghao.tnb.content.app.vod.model.vo.BannerVideoVO">
        select video_id,title,cover_url
        from vod_banner_video
        limit 10
    </select>
</mapper>