Pu Zhibing
2025-07-03 0c82398dad95f536e22b5e1966f79aa29b2cf1c9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/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="null != objectId">
         and rr.objectId = #{objectId}
      </if>
   </select>
@@ -32,7 +35,7 @@
   <select id="roleTreeList" resultType="com.stylefeng.guns.core.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 objectId = #{objectId}
   </select>
   <select id="roleTreeListByRoleId" resultType="com.stylefeng.guns.core.node.ZTreeNode">
@@ -63,14 +66,14 @@
      ID
      FROM
      sys_role
      WHERE
      WHERE r.objectId = #{objectId} and
      ID IN
      <foreach collection="array" index="index" item="i" open="(" separator="," close=")">
         #{i}
      </foreach>
      ) r1 ON r.ID = r1.ID
      ) r1 ON r.ID = r1.ID where objectId = #{objectId}
      ORDER BY
      pId,
      num ASC