<insert id="insertBatch" parameterType="xxx" >
<foreach collection="list" item="item" index="index" separator=";" >
insert into table (`key`) values (#{item.key}) ON DUPLICATE KEY UPDATE
<if test="item.y != null"> y = #{item.y} </if>
</foreach>
</insert>