2024-08-17 12:11:19 +08:00
|
|
|
<?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.yanzhu.system.mapper.SysUserPostMapper">
|
|
|
|
|
|
|
|
<resultMap type="SysUserPost" id="SysUserPostResult">
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
<result property="postId" column="post_id" />
|
2025-01-10 17:45:27 +08:00
|
|
|
<result property="projectId" column="project_id" />
|
2024-08-17 12:11:19 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<delete id="deleteUserPostByUserId" parameterType="Long">
|
|
|
|
delete from sys_user_post where user_id=#{userId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<select id="countUserPostById" resultType="Integer">
|
|
|
|
select count(1) from sys_user_post where post_id=#{postId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<delete id="deleteUserPost" parameterType="Long">
|
|
|
|
delete from sys_user_post where user_id in
|
|
|
|
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
|
|
|
#{userId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
2025-01-10 17:45:27 +08:00
|
|
|
|
|
|
|
<delete id="deleteUserPostByUser" parameterType="SysUserPost">
|
|
|
|
delete from sys_user_post where user_id=#{userId} and project_id=#{projectId}
|
|
|
|
</delete>
|
2024-08-17 12:11:19 +08:00
|
|
|
|
|
|
|
<insert id="batchUserPost">
|
2025-01-10 17:45:27 +08:00
|
|
|
insert into sys_user_post(user_id, post_id,project_id) values
|
2024-08-17 12:11:19 +08:00
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
2025-01-10 17:45:27 +08:00
|
|
|
(#{item.userId},#{item.postId},#{item.projectId})
|
2024-08-17 12:11:19 +08:00
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
</mapper>
|