<?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.mcwl.resource.mapper.SysUserAttentionMapper">

    <delete id="deleteByUserId">
        delete from sys_user_attention where  user_id = #{userId} and to_user_id = #{toUserId}
    </delete>


    <select id="selectAttention" resultType="com.mcwl.resource.domain.SysUserAttention">
        select id,user_id,to_user_id from sys_user_attention where user_id = #{userId} and to_user_id = #{toUserId}
    </select>

    <select id="selectBean" resultType="java.lang.Long">
        SELECT count(id) bean FROM sys_user_attention where to_user_id = #{userId} ORDER BY(to_user_id);
    </select>

    <select id="selectAttentionCount" resultType="java.lang.Long">
        SELECT count(id)attention FROM sys_user_attention where user_id = #{userId} ORDER BY(user_id);
    </select>
</mapper>
