多租户层级查询优化

This commit is contained in:
2025-10-09 19:17:46 +08:00
parent 6bfc01d2fc
commit ff47d983e3
7 changed files with 302 additions and 216 deletions
@@ -130,4 +130,20 @@
ORDER BY q.tourism_id DESC
</select>
<!-- 全部景区ID(webApp全库统计使用) -->
<select id="findAllTourismIds" resultType="java.lang.Long">
SELECT id FROM tourisms WHERE is_del = 0 ORDER BY id DESC
</select>
<!-- 根据单个租户ID查询景区ID集合 -->
<select id="findTourismIdsByTenantId" resultType="java.lang.Long">
SELECT id FROM tourisms
WHERE is_del = 0
<if test="tenantId != null and tenantId != ''">
AND tenant_id = #{tenantId}
</if>
ORDER BY id DESC
</select>
</mapper>