From 3f2a477b1c3e4323e9de59fe96b75e69a1fb90d3 Mon Sep 17 00:00:00 2001 From: liding <756868258@qq.com> Date: 星期三, 07 五月 2025 14:45:44 +0800 Subject: [PATCH] mybatiesPlus --- src/main/resources/mapper/system/SysUserPostMapper.xml | 66 ++++++++++++++++---------------- 1 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/main/resources/mybatis/system/SysUserPostMapper.xml b/src/main/resources/mapper/system/SysUserPostMapper.xml similarity index 92% rename from src/main/resources/mybatis/system/SysUserPostMapper.xml rename to src/main/resources/mapper/system/SysUserPostMapper.xml index d634c8b..2a0ba15 100644 --- a/src/main/resources/mybatis/system/SysUserPostMapper.xml +++ b/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -1,34 +1,34 @@ -<?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.project.system.mapper.SysUserPostMapper"> - - <resultMap type="SysUserPost" id="SysUserPostResult"> - <result property="userId" column="user_id" /> - <result property="postId" column="post_id" /> - </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> - - <insert id="batchUserPost"> - insert into sys_user_post(user_id, post_id) values - <foreach item="item" index="index" collection="list" separator=","> - (#{item.userId},#{item.postId}) - </foreach> - </insert> - +<?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.project.system.mapper.SysUserPostMapper"> + + <resultMap type="com.ruoyi.project.system.domain.SysUserPost" id="SysUserPostResult"> + <result property="userId" column="user_id" /> + <result property="postId" column="post_id" /> + </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> + + <insert id="batchUserPost"> + insert into sys_user_post(user_id, post_id) values + <foreach item="item" index="index" collection="list" separator=","> + (#{item.userId},#{item.postId}) + </foreach> + </insert> + </mapper> \ No newline at end of file -- Gitblit v1.9.3