init
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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.timeline.user.dao.FriendNotifyMapper">
|
||||
|
||||
<insert id="insert" parameterType="com.timeline.user.entity.FriendNotify">
|
||||
INSERT INTO friend_notify (from_user_id, to_user_id, type, status, content, create_time)
|
||||
VALUES (#{fromUserId}, #{toUserId}, #{type}, #{status}, #{content}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<select id="selectUnread" resultType="com.timeline.user.entity.FriendNotify">
|
||||
SELECT * FROM friend_notify
|
||||
WHERE to_user_id = #{toUserId} AND status = 'unread'
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectAllByUser" resultType="com.timeline.user.entity.FriendNotify">
|
||||
SELECT * FROM friend_notify
|
||||
WHERE to_user_id = #{toUserId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<update id="markRead">
|
||||
UPDATE friend_notify
|
||||
SET status = 'read', read_time = NOW()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user