| | |
| | | |
| | | <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> |
| | | |
| | |
| | | <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", |
| | |
| | | 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, |