diff --git a/db/20240802新增sql.sql b/db/20240802新增sql.sql index 48b57472..0efe23ed 100644 --- a/db/20240802新增sql.sql +++ b/db/20240802新增sql.sql @@ -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); diff --git a/laws-modules/src/main/java/com/jero/modules/sys/mapper/xml/SysGroupMapper.xml b/laws-modules/src/main/java/com/jero/modules/sys/mapper/xml/SysGroupMapper.xml index 17fe0902..f358fc52 100644 --- a/laws-modules/src/main/java/com/jero/modules/sys/mapper/xml/SysGroupMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/sys/mapper/xml/SysGroupMapper.xml @@ -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 @@ group by sg.id,sg.group_name - order by sg.create_time desc + order by is_admin_created desc, sg.create_time desc