update:修改分组数据的排序,管理员自己创建的分组排在前面
This commit is contained in:
@@ -19,3 +19,9 @@ CREATE TABLE `sys_user_group` (
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户分组表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`, `app_id`) VALUES ('897f89d79111ddc0019111df7bc70004', '897f89d79111ddc0019111ddc0240000', '删除', NULL, NULL, NULL, NULL, 2, 'sys:groupManage:delete', '1', 4.00, 0, NULL, 1, 1, 0, 0, NULL, 'ldq1', '2024-08-02 14:55:45', NULL, NULL, 0, 0, '1', 0, NULL, NULL);
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`, `app_id`) VALUES ('897f89d79111ddc0019111df26ae0003', '897f89d79111ddc0019111ddc0240000', '编辑', NULL, NULL, NULL, NULL, 2, 'sys:groupManage:edit', '1', 3.00, 0, NULL, 1, 1, 0, 0, NULL, 'ldq1', '2024-08-02 14:55:23', NULL, NULL, 0, 0, '1', 0, NULL, NULL);
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`, `app_id`) VALUES ('897f89d79111ddc0019111dedcca0002', '897f89d79111ddc0019111ddc0240000', '新增', NULL, NULL, NULL, NULL, 2, 'sys:groupManage:add', '1', 2.00, 0, NULL, 1, 1, 0, 0, NULL, 'ldq1', '2024-08-02 14:55:04', NULL, NULL, 0, 0, '1', 0, NULL, NULL);
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`, `app_id`) VALUES ('897f89d79111ddc0019111de80370001', '897f89d79111ddc0019111ddc0240000', '查询', NULL, NULL, NULL, NULL, 2, 'sys:groupManage:search', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'ldq1', '2024-08-02 14:54:40', NULL, NULL, 0, 0, '1', 0, NULL, NULL);
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`, `app_id`) VALUES ('897f89d79111ddc0019111ddc0240000', 'd7d6e2e4e2934f2c9385a623fd98c6f3', '分组管理', '/system/groupManage', 'system/groupManage/GroupManageList', NULL, NULL, 1, NULL, '1', 10.00, 0, NULL, 1, 0, 0, 0, NULL, 'ldq1', '2024-08-02 14:53:51', NULL, NULL, 0, 0, '1', 0, NULL, NULL);
|
||||
|
||||
@@ -10,7 +10,11 @@
|
||||
sg.create_time,
|
||||
count(sug.id) as count,
|
||||
GROUP_CONCAT(sug.user_id) as ids,
|
||||
GROUP_CONCAT(CONCAT(su.realname, '(', su.username, ')') ORDER BY su.realname, su.username) as userNames
|
||||
GROUP_CONCAT(CONCAT(su.realname, '(', su.username, ')') ORDER BY su.realname, su.username) as userNames,
|
||||
CASE
|
||||
WHEN sg.create_by = #{sysGroup.currentUserName} THEN 1
|
||||
ELSE 0
|
||||
END as is_admin_created
|
||||
from sys_group sg
|
||||
LEFT JOIN sys_user_group sug on sg.id = sug.group_id
|
||||
LEFT JOIN sys_user su on sug.user_id = su.id
|
||||
@@ -33,7 +37,7 @@
|
||||
</if>
|
||||
</where>
|
||||
group by sg.id,sg.group_name
|
||||
order by sg.create_time desc
|
||||
order by is_admin_created desc, sg.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryOne" resultType="com.jero.modules.sys.entity.SysGroup">
|
||||
|
||||
Reference in New Issue
Block a user