<?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.huiju.estateagents.property.dao.ToCommunitiesMapper">

    <insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.ArrayList">
        insert into tp_building_owner_info(org_id,id_card, building,unit, `level`,
        room_no,owner_name,owner_tel,gender,pair_status,verify_status,create_user,create_date,update_user,update_date)
        VALUES
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.orgId},#{item.idCard},#{item.building},#{item.unit}, #{item.level},#{item.roomNo},#{item.ownerName},
            #{item.ownerTel},#{item.gender},#{item.pairStatus},#{item.verifyStatus},#{item.createUser},#{item.createDate},#{item.updateUser},#{item.updateDate})
        </foreach>
    </insert>

    <update id="batchUpdate" parameterType="java.util.ArrayList">
        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
            update tp_building_owner_info
            <set>
                verify_status=${item.verifyStatus}
            </set>
            where id = ${item.id}
        </foreach>
    </update>
</mapper>
