mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化数据权限sql 解决MP apply注入附带 AND 语法问题
This commit is contained in:
		@@ -40,7 +40,9 @@
 | 
			
		||||
            AND status = #{status}
 | 
			
		||||
        </if>
 | 
			
		||||
        <!-- 数据范围过滤 -->
 | 
			
		||||
        AND ( ${params.dataScope} )
 | 
			
		||||
        <if test="params.dataScope != null and params.dataScope != ''">
 | 
			
		||||
            AND ( ${params.dataScope} )
 | 
			
		||||
        </if>
 | 
			
		||||
        order by d.parent_id, d.order_num
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,9 @@
 | 
			
		||||
            and date_format(r.create_time,'%y%m%d') <= date_format(#{role.params.endTime},'%y%m%d')
 | 
			
		||||
        </if>
 | 
			
		||||
        <!-- 数据范围过滤 -->
 | 
			
		||||
        ${role.params.dataScope}
 | 
			
		||||
        <if test="role.params.dataScope != null and role.params.dataScope != ''">
 | 
			
		||||
            AND ( ${role.params.dataScope} )
 | 
			
		||||
        </if>
 | 
			
		||||
        order by r.role_sort
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
@@ -81,7 +83,9 @@
 | 
			
		||||
            and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
 | 
			
		||||
        </if>
 | 
			
		||||
        <!-- 数据范围过滤 -->
 | 
			
		||||
        AND ( ${params.dataScope} )
 | 
			
		||||
        <if test="params.dataScope != null and params.dataScope != ''">
 | 
			
		||||
            AND ( ${params.dataScope} )
 | 
			
		||||
        </if>
 | 
			
		||||
        order by r.role_sort
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -106,7 +106,9 @@
 | 
			
		||||
            ancestors) ))
 | 
			
		||||
        </if>
 | 
			
		||||
        <!-- 数据范围过滤 -->
 | 
			
		||||
        ${user.params.dataScope}
 | 
			
		||||
        <if test="user.params.dataScope != null and user.params.dataScope != ''">
 | 
			
		||||
            AND ( ${user.params.dataScope} )
 | 
			
		||||
        </if>
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
 | 
			
		||||
@@ -135,7 +137,9 @@
 | 
			
		||||
            ancestors) ))
 | 
			
		||||
        </if>
 | 
			
		||||
        <!-- 数据范围过滤 -->
 | 
			
		||||
        AND ( ${params.dataScope} )
 | 
			
		||||
        <if test="params.dataScope != null and params.dataScope != ''">
 | 
			
		||||
            AND ( ${params.dataScope} )
 | 
			
		||||
        </if>
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user