<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mappernamespace="com.zehong.system.mapper.SysUserPostMapper"><resultMaptype="SysUserPost"id="SysUserPostResult"><resultproperty="userId"column="user_id"/><resultproperty="postId"column="post_id"/></resultMap><deleteid="deleteUserPostByUserId"parameterType="Long"> delete from sys_user_post where user_id=#{userId}</delete><selectid="countUserPostById"resultType="Integer"> select count(1) from sys_user_post where post_id=#{postId} </select><deleteid="deleteUserPost"parameterType="Long"> delete from sys_user_post where user_id in<foreachcollection="array"item="userId"open="("separator=","close=")"> #{userId}</foreach></delete><insertid="batchUserPost"> insert into sys_user_post(user_id, post_id) values<foreachitem="item"index="index"collection="list"separator=","> (#{item.userId},#{item.postId})</foreach></insert></mapper>