<?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.shkj.system.mapper.SysUserConsignorMapper">

	<resultMap type="com.shkj.system.domain.SysUserConsignor" id="SysUserConsignorResult">
		<result property="userId"     column="user_id"      />
		<result property="consignorId"     column="consignor_id"      />
	</resultMap>

	<delete id="deleteUserConsignorByUserId" parameterType="Long">
		delete from sys_user_consignor where user_id=#{userId}
	</delete>

	
	<delete id="deleteUserConsignor" parameterType="Long">
 		delete from sys_user_consignor where user_id in
 		<foreach collection="array" item="userId" open="(" separator="," close=")">
 			#{userId}
        </foreach> 
 	</delete>
	
	<insert id="batchUserConsignor">
		insert into sys_user_consignor(user_id, consignor_id) values
		<foreach item="item" index="index" collection="list" separator=",">
			(#{item.userId},#{item.consignorId})
		</foreach>
	</insert>
	
</mapper> 