diff --git a/features/sys_menu/service/repo_sys_menu.go b/features/sys_menu/service/repo_sys_menu.go index 301d10ca..49b6497b 100644 --- a/features/sys_menu/service/repo_sys_menu.go +++ b/features/sys_menu/service/repo_sys_menu.go @@ -79,7 +79,7 @@ func (r *RepoSysMenu) SelectMenuList(sysMenu model.SysMenu, userId string) []mod var conditions []string var params []any if sysMenu.MenuName != "" { - conditions = append(conditions, "m.menu_name like concat(?, '%')") + conditions = append(conditions, "m.menu_name like concat('%', concat(?, '%'))") params = append(params, sysMenu.MenuName) } if sysMenu.Visible != "" { diff --git a/features/sys_menu/service/service_sys_menu.go b/features/sys_menu/service/service_sys_menu.go index 03311dbd..3c71d17c 100644 --- a/features/sys_menu/service/service_sys_menu.go +++ b/features/sys_menu/service/service_sys_menu.go @@ -62,6 +62,7 @@ func sysMenuTreeSelect(sysMenu model.SysMenu) vo.TreeSelect { t := vo.TreeSelect{} t.ID = sysMenu.MenuID t.Label = sysMenu.MenuName + t.Title = sysMenu.MenuName if len(sysMenu.Children) > 0 { for _, menu := range sysMenu.Children { diff --git a/features/sys_role/service/repo_sys_role.go b/features/sys_role/service/repo_sys_role.go index 7fea81c0..00354a36 100644 --- a/features/sys_role/service/repo_sys_role.go +++ b/features/sys_role/service/repo_sys_role.go @@ -71,11 +71,11 @@ func (r *RepoSysRole) SelectRolePage(query map[string]any) map[string]any { params = append(params, v) } if v, ok := query["roleName"]; ok && v != "" { - conditions = append(conditions, "r.role_name like concat(?, '%')") + conditions = append(conditions, "r.role_name like concat('%', concat(?, '%'))") params = append(params, v) } if v, ok := query["roleKey"]; ok && v != "" { - conditions = append(conditions, "r.role_key like concat(?, '%')") + conditions = append(conditions, "r.role_key like concat('%', concat(?, '%'))") params = append(params, v) } if v, ok := query["status"]; ok && v != "" { @@ -154,11 +154,11 @@ func (r *RepoSysRole) SelectRoleList(sysRole model.SysRole) []model.SysRole { params = append(params, sysRole.RoleID) } if sysRole.RoleKey != "" { - conditions = append(conditions, "r.role_key like concat(?, '%')") + conditions = append(conditions, "r.role_key like concat('%', concat(?, '%'))") params = append(params, sysRole.RoleKey) } if sysRole.RoleName != "" { - conditions = append(conditions, "r.role_name like concat(?, '%')") + conditions = append(conditions, "r.role_name like concat('%', concat(?, '%'))") params = append(params, sysRole.RoleName) } if sysRole.Status != "" { diff --git a/features/sys_user/service/repo_sys_user.go b/features/sys_user/service/repo_sys_user.go index 1132f2cd..2d2cc67e 100644 --- a/features/sys_user/service/repo_sys_user.go +++ b/features/sys_user/service/repo_sys_user.go @@ -137,7 +137,7 @@ func (r *RepoSysUser) SelectUserPage(query map[string]any) map[string]any { params = append(params, v) } if v, ok := query["name"]; ok && v != "" { - conditions = append(conditions, "u.name like concat(?, '%')") + conditions = append(conditions, "u.name concat('%', concat(?, '%'))") params = append(params, v) } if v, ok := query["status"]; ok && v != "" { @@ -145,7 +145,7 @@ func (r *RepoSysUser) SelectUserPage(query map[string]any) map[string]any { params = append(params, v) } if v, ok := query["phonenumber"]; ok && v != "" { - conditions = append(conditions, "u.phonenumber like concat(?, '%')") + conditions = append(conditions, "u.phonenumber like concat('%', concat(?, '%'))") params = append(params, v) } beginTime, ok := query["beginTime"] @@ -219,11 +219,11 @@ func (r *RepoSysUser) SelectAllocatedPage(query map[string]any) map[string]any { var conditions []string var params []any if v, ok := query["name"]; ok && v != "" { - conditions = append(conditions, "u.name like concat(?, '%')") + conditions = append(conditions, "u.name like concat('%', concat(?, '%'))") params = append(params, v) } if v, ok := query["phone"]; ok && v != "" { - conditions = append(conditions, "u.phone like concat(?, '%')") + conditions = append(conditions, "u.phone like concat('%', concat(?, '%'))") params = append(params, v) } if v, ok := query["status"]; ok && v != "" { @@ -321,7 +321,7 @@ func (r *RepoSysUser) SelectUserList(sysUser sysUserModel.SysUser, dataScopeSQL params = append(params, sysUser.Status) } if sysUser.Phone != "" { - conditions = append(conditions, "u.phone like concat(?, '%')") + conditions = append(conditions, "u.phone like concat('%', concat(?, '%'))") params = append(params, sysUser.Phone) }