数据权限的修改

This commit is contained in:
1745237360-cloud
2026-01-10 16:39:33 +08:00
parent 29b24e8450
commit 4b427e1b2e
97 changed files with 3056 additions and 466 deletions
@@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="approvalNumber" column="approval_number" />
<result property="isInvoice" column="is_invoice" />
@@ -134,12 +135,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateByName != null and updateByName != ''">
and a.update_by_name like concat('%', #{updateByName}, '%')
</if>
<!-- 组织ID过滤条件:如果设置了organizationId,则按组织ID精确匹配 -->
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<!-- 一级组织ID过滤条件:如果设置了topOrganizationId,则按一级组织ID匹配 -->
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<!-- 组织名称模糊查询条件:如果前端传入了组织名称,则按组织名称模糊匹配 -->
<if test="organizationName != null and organizationName != ''">
and a.organization_name LIKE CONCAT('%',#{organizationName},'%')
</if>
<!-- 当设置了组织相关查询条件时,确保organization_name不为null且不为空字符串 -->
<if test="organizationId != null or topOrganizationId != null or (organizationName != null and organizationName != '')">
and a.organization_name IS NOT NULL
and a.organization_name &lt;&gt; ''
and LENGTH(TRIM(a.organization_name)) > 0
</if>
<if test="collectionTimeStart != null and collectionTimeEnd != null">
AND (date_format(a.collection_time,'%Y-%m-%d') >= date_format(#{collectionTimeStart},'%Y-%m-%d')
and date_format(a.collection_time,'%Y-%m-%d') <![CDATA[<=]]> date_format(#{collectionTimeEnd},'%Y-%m-%d'))