<?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.ruoyi.system.mapper.SysUserPostMapper">

	<resultMap type="com.ruoyi.system.domain.SysUserPost" id="SysPostResult">
		<result property="userId"     column="user_id"      />
		<result property="postId"     column="post_id"      />
	</resultMap>

	<select id="countUserPostByPostId" resultType="java.lang.Long">
	    SELECT COUNT(1)
	    FROM sys_user_post
	    WHERE post_id = #{postId}
	</select>

	<delete id="deleteUserPostByUserId" parameterType="java.lang.Long">
		DELETE FROM sys_user_post
		WHERE user_id = #{userId}
	</delete>

	<delete id="deleteUserPost" parameterType="java.lang.Long">
		DELETE FROM sys_user_post
		WHERE user_id IN
		<foreach collection="array" item="userId" open="(" separator="," close=")">
			#{userId}
		</foreach>
	</delete>

</mapper>