java好友功能
因需要分页功能,通过sql进行分页查询
数据库设计
主键 | 用户id | 关注用户id |
---|---|---|
id | user_id | collection_id |
sql语句
1 | select a.user_id,a.collection_id from ln_collection a inner join ln_collection b on a.collection_id = b.user_id and a.user_id = b.collection_id where a.user_id = #{userId} |