You've already forked FrameTour-BE
feat(notify): 添加批量查询用户授权余额功能
- 新增批量查询用户授权余额接口 /api/mobile/notify/auth/batch-remaining - 实现批量检查用户对多个模板的授权记录功能 - 添加景区所有场景及模板列表查询接口并支持缓存 - 优化授权记录查询性能,使用批量查询替代逐个查询 - 新增批量查询请求对象 BatchRemainingCountReq 和响应对象 WechatSubscribeAllScenesResp - 在数据层添加批量查询用户授权记录的 SQL 映射 - 实现缓存管理机制,支持所有场景模板配置的缓存读写与清理
This commit is contained in:
@@ -92,12 +92,26 @@
|
||||
<select id="selectRemainingCount" resultType="java.lang.Integer">
|
||||
SELECT COALESCE(remaining_count, 0)
|
||||
FROM user_notification_authorization
|
||||
WHERE member_id = #{memberId}
|
||||
WHERE member_id = #{memberId}
|
||||
AND template_id = #{templateId}
|
||||
AND scenic_id = #{scenicId}
|
||||
AND status = 1
|
||||
AND remaining_count > 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 批量查询用户对多个模板的授权记录 -->
|
||||
<select id="selectBatchByTemplateIds" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM user_notification_authorization
|
||||
WHERE member_id = #{memberId}
|
||||
AND scenic_id = #{scenicId}
|
||||
AND status = 1
|
||||
AND template_id IN
|
||||
<foreach collection="templateIds" item="templateId" open="(" separator="," close=")">
|
||||
#{templateId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user