提交 | 用户 | 时间
|
e57a89
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
懒 |
2 |
<!DOCTYPE mapper |
|
3 |
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
4 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
5 |
<mapper namespace="com.jcdm.system.mapper.SysUserPostMapper"> |
|
6 |
|
|
7 |
<resultMap type="SysUserPost" id="SysUserPostResult"> |
|
8 |
<result property="userId" column="user_id" /> |
|
9 |
<result property="postId" column="post_id" /> |
|
10 |
</resultMap> |
|
11 |
|
|
12 |
<delete id="deleteUserPostByUserId" parameterType="Long"> |
|
13 |
delete from sys_user_post where user_id=#{userId} |
|
14 |
</delete> |
|
15 |
|
|
16 |
<select id="countUserPostById" resultType="Integer"> |
|
17 |
select count(1) from sys_user_post where post_id=#{postId} |
|
18 |
</select> |
|
19 |
|
|
20 |
<delete id="deleteUserPost" parameterType="Long"> |
|
21 |
delete from sys_user_post where user_id in |
|
22 |
<foreach collection="array" item="userId" open="(" separator="," close=")"> |
|
23 |
#{userId} |
|
24 |
</foreach> |
|
25 |
</delete> |
|
26 |
|
|
27 |
<insert id="batchUserPost"> |
|
28 |
insert into sys_user_post(user_id, post_id) values |
|
29 |
<foreach item="item" index="index" collection="list" separator=","> |
|
30 |
(#{item.userId},#{item.postId}) |
|
31 |
</foreach> |
|
32 |
</insert> |
|
33 |
|
|
34 |
</mapper> |