visionegg | 5dfc41a | 2025-05-19 14:36:47 +0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | <mapper namespace="com.ruoyi.system.mapper.SysUserFollowMapper"> |
| 4 | <resultMap id="SysUserFollowMap" type="com.ruoyi.system.domain.SysUserFollow"> |
| 5 | <id property="followId" column="follow_id"/> |
| 6 | <result property="userId" column="user_id"/> |
| 7 | <result property="authorId" column="author_id"/> |
| 8 | <result property="createTime" column="create_time"/> |
| 9 | </resultMap> |
| 10 | |
| 11 | <insert id="insertFollow" parameterType="com.ruoyi.system.domain.SysUserFollow"> |
| 12 | insert into sys_user_follow (user_id, author_id, create_time) |
| 13 | values (#{userId}, #{authorId}, sysdate()) |
| 14 | </insert> |
| 15 | |
| 16 | <delete id="deleteFollow"> |
| 17 | delete from sys_user_follow where user_id = #{userId} and author_id = #{authorId} |
| 18 | </delete> |
| 19 | |
| 20 | <select id="selectFollowListByUserId" resultMap="SysUserFollowMap"> |
| 21 | select follow_id, user_id, author_id, create_time |
| 22 | from sys_user_follow |
| 23 | where user_id = #{userId} |
| 24 | </select> |
| 25 | |
| 26 | <select id="selectFollow" resultMap="SysUserFollowMap"> |
| 27 | select follow_id, user_id, author_id, create_time |
| 28 | from sys_user_follow |
| 29 | where user_id = #{userId} and author_id = #{authorId} |
| 30 | </select> |
visionegg | 55cafb3 | 2025-06-07 21:22:13 +0800 | [diff] [blame^] | 31 | |
| 32 | <select id="selectUserIdByUsername" resultType="java.lang.Long"> |
| 33 | select user_id |
| 34 | from sys_user |
| 35 | where user_name = #{username} |
| 36 | </select> |
visionegg | 5dfc41a | 2025-05-19 14:36:47 +0800 | [diff] [blame] | 37 | </mapper> |