| | |
| | | AND del_flag = 0 |
| | | </where> |
| | | </select> |
| | | <select id="selectList" resultType="com.ruoyi.common.core.domain.entity.SysRole"> |
| | | select role_id AS roleId, role_name AS roleName, role_key AS roleKey, role_sort AS roleSort, data_scope AS dataScope, |
| | | menu_check_strictly AS menuCheckStrictly, dept_check_strictly AS deptCheckStrictly,status AS status, del_flag AS delFlag, |
| | | create_time AS createTime,create_by AS createBy,postType AS postType,removeDays AS removeDays |
| | | from sys_role |
| | | <select id="selectPageList" resultType="com.ruoyi.common.core.domain.entity.SysRole"> |
| | | select a.role_id AS roleId, a.role_name AS roleName, a.role_key AS roleKey, a.role_sort AS roleSort, a.data_scope AS dataScope, |
| | | a.menu_check_strictly AS menuCheckStrictly, a.dept_check_strictly AS deptCheckStrictly,a.status AS status, a.del_flag AS delFlag, |
| | | a.create_time AS createTime,a.create_by AS createBy,a.postType AS postType,a.removeDays AS removeDays, |
| | | IFNULL(b.userCount,0) as userCount |
| | | from sys_role a |
| | | LEFT JOIN |
| | | (SELECT |
| | | r.role_id AS roleId, |
| | | COUNT(ur.user_id) AS userCount |
| | | FROM sys_role r |
| | | LEFT JOIN sys_user_role ur ON r.role_id = ur.role_id |
| | | where r.del_flag = 0 |
| | | GROUP BY r.role_id) b on a.role_id = b.roleId |
| | | <where> |
| | | <if test="query.roleName != null and query.roleName != ''"> |
| | | AND role_name LIKE concat('%',#{query.roleName},'%') |
| | | AND a.role_name LIKE concat('%',#{query.roleName},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | AND status = #{query.status} |
| | | AND a.status = #{query.status} |
| | | </if> |
| | | AND del_flag = 0 |
| | | AND a.del_flag = 0 |
| | | </where> |
| | | </select> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |