Files
2023-05-18 17:29:02 +08:00

29 lines
973 B
XML

<?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.qiaoba.module.system.mapper.SysUserPostMapper">
<select id="selectPostIdsByUserId" resultType="string">
select post_id from sys_user_post where user_id = #{userId}
</select>
<select id="selectUsedPostNameByIds" resultType="string">
select DISTINCT t1.post_name
from sys_post t1
LEFT JOIN sys_user_post t2
on t1.post_id = t2.post_id
where t2.post_id in
<foreach collection="list" item="postId" open="(" separator="," close=")">
#{postId}
</foreach>
</select>
<delete id="deleteByUserIds">
delete from sys_user_post where user_id in
<foreach collection="list" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</mapper>