2017-08-15 09:47:18 +07: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" >
|
2017-08-18 16:08:27 +07:00
|
|
|
<mapper namespace="io.spring.infrastructure.mybatis.readservice.UserRelationshipQueryService">
|
2017-08-15 09:47:18 +07:00
|
|
|
<select id="isUserFollowing" resultType="java.lang.Boolean">
|
|
|
|
select count(1) from follows where user_id = #{userId} and follow_id = #{anotherUserId}
|
|
|
|
</select>
|
2017-08-17 16:17:37 +07:00
|
|
|
<select id="followingAuthors" resultType="java.lang.String">
|
|
|
|
select F.follow_id from follows F
|
|
|
|
where F.follow_id in
|
|
|
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
and F.user_id = #{userId}
|
|
|
|
</select>
|
|
|
|
<select id="followedUsers" resultType="java.lang.String">
|
|
|
|
select F.follow_id from follows F where F.user_id = #{userId}
|
|
|
|
</select>
|
2017-08-15 09:47:18 +07:00
|
|
|
</mapper>
|