✨ 粉丝与关注用户列表功能
This commit is contained in:
parent
04f2b3626c
commit
22e0818e05
@ -1,8 +1,24 @@
|
||||
<?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.rymcu.vertical.mapper.FollowMapper">
|
||||
<resultMap id="DTOResultMapper" type="com.rymcu.vertical.dto.UserDTO">
|
||||
<result column="id" property="idUser"/>
|
||||
<result column="account" property="account"/>
|
||||
<result column="nickname" property="nickname"/>
|
||||
<result column="avatar_type" property="avatarType"/>
|
||||
<result column="avatar_url" property="avatarUrl"/>
|
||||
<result column="signature" property="signature"/>
|
||||
</resultMap>
|
||||
<select id="isFollow" resultType="java.lang.Boolean">
|
||||
select ifnull((select true from vertical_follow where follower_id = #{followerId}
|
||||
and following_id = #{followingId} and following_type = #{followingType}), false)
|
||||
</select>
|
||||
<select id="selectUserFollowersByUser" resultMap="DTOResultMapper">
|
||||
select id, nickname, avatar_type, avatar_url, account, signature from vertical_user vu
|
||||
where exists (select * from vertical_follow vf where following_type = 0 and following_id = #{idUser} and follower_id = vu.id limit 1)
|
||||
</select>
|
||||
<select id="selectUserFollowingsByUser" resultMap="DTOResultMapper">
|
||||
select id, nickname, avatar_type, avatar_url, account, signature from vertical_user vu
|
||||
where id = #{idUser} and exists (select * from vertical_follow vf where following_type = 0 and follower_id = #{idUser} and following_id = vu.id limit 1)
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user