<?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.VipTagMapper">
    <insert id="save" useGeneratedKeys="true" keyProperty="id">
        insert into vod_vip_tag
        (`pid`,`name`,`tag_id`)
        values
        (#{pid},#{name},#{tagId})
    </insert>
    <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
        insert ignore into vod_vip_tag
        (`pid`,`name`,`tag_id`)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.pid},#{item.name},#{item.tagId})
        </foreach>
    </insert>

    <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VipTag">
        select *
        from vod_vip_tag
        limit 1000
    </select>
    <select id="findByPid" resultType="cn.reghao.tnb.content.app.vod.model.po.VipTag">
        select * 
        from vod_vip_tag 
        where pid=#{pid}
    </select>
</mapper>