消息通知系统

This commit is contained in:
2024-08-15 16:25:44 +08:00
parent 704e3c25bf
commit 085dac0630
20 changed files with 768 additions and 136 deletions

View 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>