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


    <insert id="flushMatmap">
        insert into pro_matmap (
        pos_idx, mat_id, plan_no, plan_id
        )
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.posIdx}, #{item.matId}, #{item.planNo}, #{item.planId})
        </foreach>
        on duplicate key update
        mat_id = VALUES(mat_id),
        plan_no = VALUES(plan_no),
        plan_id = VALUES(plan_id)
    </insert>

</mapper>