数据权限的bug修改260113

This commit is contained in:
1745237360-cloud
2026-01-13 20:43:04 +08:00
parent 8924757467
commit 6606c65d73
3 changed files with 170 additions and 27 deletions
@@ -102,11 +102,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set del_flag = 2,
update_time = now()
where del_flag = 1
<if test="topOrganizationId != null and topOrganizationId != ''">
and top_organization_id = #{topOrganizationId}
</if>
<!-- 必须匹配 organizationId,确保只删除当前登录用户组织的数据 -->
<!-- 只根据 organizationId 来删除,不使用 topOrganizationId -->
<if test="organizationId != null and organizationId != ''">
and organization_id = #{organizationId}
</if>
<!-- 如果 organizationId 为空,则不执行删除操作,防止误删所有数据 -->
<if test="organizationId == null or organizationId == ''">
and 1 = 0
</if>
</update>
</mapper>