数据权限的修改
This commit is contained in:
@@ -217,11 +217,19 @@
|
||||
and a.user_id = #{userId}
|
||||
</if>
|
||||
|
||||
<if test="organizationId !=null">
|
||||
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
||||
<if test="organizationId != null">
|
||||
<!-- 如果设置了 organizationId,添加 organization_id 条件 -->
|
||||
and a.organization_id = #{organizationId}
|
||||
and a.organization_name IS NOT NULL
|
||||
</if>
|
||||
<if test="topOrganizationId !=null">
|
||||
<if test="topOrganizationId != null">
|
||||
<!-- 如果设置了 topOrganizationId,添加 top_organization_id 条件 -->
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
<if test="organizationId == null">
|
||||
<!-- 如果没有设置 organizationId,添加 organization_name IS NOT NULL 条件 -->
|
||||
and a.organization_name IS NOT NULL
|
||||
</if>
|
||||
</if>
|
||||
/*组织名称*/
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
@@ -708,7 +716,7 @@
|
||||
</select>
|
||||
|
||||
<select id="findAllShipperInfo" resultType="com.mhd.user.interfaces.vo.QueryAllShipperInfoVo">
|
||||
SELECT u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name ,u.user_phone,u.has_default_address,b.shipper_id,b.shipper_enterprise_name,u.DOCUMENT_PREPARER_NC_CODE,b.CUSTOMER_NC_CODE
|
||||
SELECT u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name ,u.user_phone,u.has_default_address,b.shipper_id,b.shipper_enterprise_name,u.DOCUMENT_PREPARER_NC_CODE,b.CUSTOMER_NC_CODE,u.organization_id AS organizationId,u.top_organization_id AS topOrganizationId
|
||||
FROM "USER" u
|
||||
LEFT JOIN user_shipper b ON u.user_id = b.user_id
|
||||
left join (select user_id, LISTAGG(r.role_name, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName
|
||||
@@ -723,9 +731,10 @@
|
||||
<if test="userId !=null">
|
||||
AND u.user_Id = #{userId}
|
||||
</if>
|
||||
/*一级组织ID*/
|
||||
<if test="topOrganizationId !=null">
|
||||
AND u.top_organization_id = #{topOrganizationId}
|
||||
/*组织ID - 数据隔离:南光组织(organizationId=2827)查询全部,其他组织查询自己组织的数据*/
|
||||
<if test="organizationId !=null">
|
||||
AND u.organization_id = #{organizationId}
|
||||
AND u.organization_name IS NOT NULL
|
||||
</if>
|
||||
GROUP BY u.user_id
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user