<?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.sb.multi.mybatis.mapper.two.PostItemMapper">
    <insert id="save" useGeneratedKeys="true" keyProperty="id">
        insert into vod_post_item
        (`album_id`,`post_id`,`pos`,`added_at`)
        values
        (#{albumId},#{postId},#{pos},#{addedAt})
    </insert>
    <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
        insert into vod_post_item
        (`album_id`,`post_id`,`pos`,`added_at`)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.albumId},#{item.postId},#{item.pos},#{item.addedAt})
        </foreach>
    </insert>
</mapper>
