<?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.ym.mec.biz.dal.dao.TenantProxyUserRelationDao">
    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantProxyUserRelation">
        <id column="id_" jdbcType="INTEGER" property="id"/>
        <id column="proxy_id_" jdbcType="INTEGER" property="proxyId"/>
        <result column="user_id_" jdbcType="INTEGER" property="userId"/>
        <result column="parent_id_" jdbcType="INTEGER" property="parentId"/>
        <result column="rank_" jdbcType="INTEGER" property="rank"/>
        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
    </resultMap>

    <sql id="Base_Column_List">
        id_,proxy_id_
        , user_id_, parent_id_, rank_, create_time_
    </sql>

    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.ym.mec.biz.dal.entity.TenantProxyUserRelation">
        insert into tenant_proxy_user_relation(user_id_, proxy_id_,parent_id_, rank_, create_time_)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.userId},#{proxyId}, #{entity.parentId}, #{entity.rank}, #{entity.createTime})
        </foreach>
    </insert>

</mapper>
