liujie
2023-10-26 5ecb954f03f2da90df620155cc98edf3b8184b3d
cloud-server-management/src/main/resources/mapper/RoleMapper.xml
@@ -19,9 +19,12 @@
   <select id="selectRoles" resultType="map">
      select rr.*,(SELECT COUNT(id) from sys_user where FIND_IN_SET(rr.id,roleid)) as userCount
      from sys_role as rr
      from sys_role as rr where 1=1
      <if test="condition != null">
         where rr.name like CONCAT('%',#{condition},'%')
         and rr.name like CONCAT('%',#{condition},'%')
      </if>
      <if test="objectType == 3">
         and rr.objType =3  and rr.objId =#{objectId}
      </if>
   </select>
@@ -32,10 +35,13 @@
   <select id="roleTreeList" resultType="com.dsh.course.model.node.ZTreeNode">
      select id "id",pId
      "pId",name as "name",(case when (pId=0 or pId is null) then 'true'
      else 'false' end) "open" from sys_role
      else 'false' end) "open" from sys_role where 1=1
      <if test="type==3">
         and objType =3 and objId =#{id}
      </if>
   </select>
   <select id="roleTreeListByRoleId" resultType="com.dsh.course.model.node.ZTreeNode">
      <select id="roleTreeListByRoleId" resultType="com.dsh.course.model.node.ZTreeNode">
      SELECT
      r.id "id",
      pId "pId",
@@ -65,11 +71,12 @@
      sys_role
      WHERE
      ID IN
      <foreach collection="array" index="index" item="i" open="(" separator="," close=")">
         #{i}
      </foreach>
      <if test="type==3">
         and objType =3 and objId =#{id}
      </if>
      ) r1 ON r.ID = r1.ID
      ORDER BY
      pId,