fix notify delete

This commit is contained in:
Timi
2026-08-29 00:49:50 +08:00
parent d747a0fdae
commit 2b5be16ad7
11 changed files with 99 additions and 24 deletions
@@ -0,0 +1,4 @@
ALTER TABLE `notify_detail`
ADD COLUMN `hidden_at` BIGINT(20) COMMENT '收件人隐藏时间' AFTER `read_at`,
DROP INDEX `idx_internal_user_send_at`,
ADD INDEX `idx_internal_user_send_at`(`msg_type` ASC, `send_to` ASC, `hidden_at` ASC, `send_at` ASC, `deleted_at` ASC) USING BTREE;
@@ -12,4 +12,26 @@
</foreach>
AND `deleted_at` IS NULL
</select>
<select id="selectRecipientPage" resultType="com.imyeyu.api.modules.gao.entity.GaoUser">
SELECT *
FROM `gao_user`
WHERE `enabled` = 1
AND (`deleted_at` IS NULL OR FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) &lt; `deleted_at`)
<if test="page.equalsExample != null and page.equalsExample.storeId != null and page.equalsExample.storeId != ''">
AND `store_id` = #{page.equalsExample.storeId}
</if>
ORDER BY COALESCE(`updated_at`, `created_at`) DESC
LIMIT #{page.offset}, #{page.limit}
</select>
<select id="countRecipients" resultType="long">
SELECT COUNT(*)
FROM `gao_user`
WHERE `enabled` = 1
AND (`deleted_at` IS NULL OR FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) &lt; `deleted_at`)
<if test="page.equalsExample != null and page.equalsExample.storeId != null and page.equalsExample.storeId != ''">
AND `store_id` = #{page.equalsExample.storeId}
</if>
</select>
</mapper>