客户超额消息通知

This commit is contained in:
wuweihua
2026-10-09 17:06:40 +08:00
parent 94e7a18e0b
commit 037d4b7cdf
20 changed files with 2065 additions and 7 deletions
@@ -0,0 +1,107 @@
package com.bms.notify.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.bms.notify.domain.NotifyMessage;
import com.bms.notify.domain.NotifyOverdueCustomer;
import com.bms.notify.domain.NotifyReceive;
import com.bms.notify.domain.NotifyRule;
import com.bms.notify.domain.NotifyRuleTarget;
/**
* 消息通知 Mapper(规则/对象/消息/接收/扫描日志)
*
* @author bms
* @date 2026-10-09
*/
public interface NotifyMapper
{
/* ================= 规则 ================= */
List<NotifyRule> selectRuleList(NotifyRule query);
NotifyRule selectRuleById(@Param("ruleId") Long ruleId);
int insertRule(NotifyRule rule);
int updateRule(NotifyRule rule);
/** 软删除规则 */
int deleteRuleByIds(@Param("ids") Long[] ids, @Param("updateBy") String updateBy);
int countEnabledRules(@Param("eventType") String eventType);
/* ================= 规则对象 ================= */
List<NotifyRuleTarget> selectTargetsByRuleId(@Param("ruleId") Long ruleId);
List<NotifyRuleTarget> selectTargetsByRuleIds(@Param("ruleIds") List<Long> ruleIds);
int insertTarget(NotifyRuleTarget target);
int deleteTargetsByRuleId(@Param("ruleId") Long ruleId);
/** 校验用户存在且为启用状态 */
int countEnabledUser(@Param("userId") Long userId);
/** 校验角色存在且为启用状态 */
int countEnabledRole(@Param("roleId") Long roleId);
/** 汇总所有启用规则的去重接收用户(直选用户 + 选中角色下用户) */
List<Long> selectRecipientUserIds(@Param("eventType") String eventType);
/* ================= 消息与接收 ================= */
List<NotifyMessage> selectMessageList(NotifyMessage query);
NotifyMessage selectMessageById(@Param("messageId") Long messageId);
int insertMessage(NotifyMessage message);
int insertReceive(NotifyReceive receive);
List<NotifyReceive> selectReceivesByMessageId(@Param("messageId") Long messageId);
/* ================= 扫描日志 ================= */
String selectScanLogStatus(@Param("eventType") String eventType,
@Param("customerId") Long customerId);
java.util.Date selectScanLogNotifyDate(@Param("eventType") String eventType,
@Param("customerId") Long customerId);
int insertScanLog(@Param("eventType") String eventType,
@Param("customerId") Long customerId,
@Param("status") String status,
@Param("notify") boolean notify);
int updateScanLog(@Param("eventType") String eventType,
@Param("customerId") Long customerId,
@Param("status") String status,
@Param("notify") boolean notify);
/** 当前不超额但日志仍为OVERDUE的客户 -> 置NORMAL */
int resetNormalForCustomers(@Param("eventType") String eventType,
@Param("customerIds") List<Long> customerIds);
/** 查询所有当前超额客户(CNY账户,有效额度口径) */
List<NotifyOverdueCustomer> selectOverdueCustomers();
/* ================= 我的消息 ================= */
/** 登录待弹屏消息(popup_flag=N) */
List<NotifyReceive> selectPopupReceives(@Param("userId") Long userId);
/** 取弹屏列表后置 popup_flag=Y(服务器时间,一次登录只弹一次) */
int markPopupShown(@Param("userId") Long userId);
/** 我的消息列表(readFlag 为空=全部) */
List<NotifyReceive> selectMineList(@Param("userId") Long userId,
@Param("readFlag") String readFlag);
int countUnread(@Param("userId") Long userId);
int markRead(@Param("receiveId") Long receiveId, @Param("userId") Long userId);
int markAllRead(@Param("userId") Long userId);
}