消息通知系统
This commit is contained in:
43
src/main/resources/mapper/primary/NotificationMapper.xml
Normal file
43
src/main/resources/mapper/primary/NotificationMapper.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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.ai.da.mapper.primary.NotificationMapper">
|
||||
|
||||
<select id="getTypeCount" resultType="java.util.Map">
|
||||
SELECT type, count(id) as count
|
||||
FROM `t_notification`
|
||||
WHERE receiver_id = #{receiverId}
|
||||
AND is_read = 0
|
||||
GROUP BY type
|
||||
</select>
|
||||
|
||||
<select id="getUniqueLikeAndFollow" resultType="com.ai.da.mapper.primary.entity.Notification">
|
||||
SELECT *
|
||||
FROM `t_notification`
|
||||
WHERE type = #{type}
|
||||
AND sender_id = #{senderId}
|
||||
AND receiver_id = #{receiverId}
|
||||
<if test="type == 'like'">
|
||||
AND portfolio_id = #{portfolioId}
|
||||
</if>
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<update id="updateUniqueLikeAndFollow" >
|
||||
UPDATE `t_notification`
|
||||
SET
|
||||
is_read = 0,
|
||||
create_time = #{time},
|
||||
update_time = #{time},
|
||||
is_deleted = 0
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteNotification" >
|
||||
UPDATE `t_notification`
|
||||
SET
|
||||
update_time = #{time},
|
||||
is_deleted = 1
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user