Browse Source

自定义角色BUG修复

wangliang 2 năm trước cách đây
mục cha
commit
a67697553c

+ 5 - 5
teachcloud-common/src/main/resources/mapper/SysRoleMapper.xml

@@ -71,12 +71,12 @@
             <if test="schoolId != null and schoolId != ''">
                 and t.school_id = #{schoolId}
             </if>
-            <if test="schoolId == null || schoolId == ''">
-                and school_id is null
-            </if>
         </where>
         union
-        <include refid="Base_Column_List"/>
-        where school_id is null and default_role = 1 and type <![CDATA[ <> ]]> 'ADMIN'
+        <include refid="Base_Column_List" /> join t_school_role tsr on tsr.role_id = t.id
+        where t.default_role = 1 and t.type <![CDATA[ <> ]]> 'ADMIN'
+        <if test="schoolId != null and schoolId != ''">
+            and tsr.school_id = #{schoolId}
+        </if>
     </select>
 </mapper>