fix: 菜单角色用户名称模糊查询
This commit is contained in:
@@ -79,7 +79,7 @@ func (r *RepoSysMenu) SelectMenuList(sysMenu model.SysMenu, userId string) []mod
|
|||||||
var conditions []string
|
var conditions []string
|
||||||
var params []any
|
var params []any
|
||||||
if sysMenu.MenuName != "" {
|
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)
|
params = append(params, sysMenu.MenuName)
|
||||||
}
|
}
|
||||||
if sysMenu.Visible != "" {
|
if sysMenu.Visible != "" {
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ func sysMenuTreeSelect(sysMenu model.SysMenu) vo.TreeSelect {
|
|||||||
t := vo.TreeSelect{}
|
t := vo.TreeSelect{}
|
||||||
t.ID = sysMenu.MenuID
|
t.ID = sysMenu.MenuID
|
||||||
t.Label = sysMenu.MenuName
|
t.Label = sysMenu.MenuName
|
||||||
|
t.Title = sysMenu.MenuName
|
||||||
|
|
||||||
if len(sysMenu.Children) > 0 {
|
if len(sysMenu.Children) > 0 {
|
||||||
for _, menu := range sysMenu.Children {
|
for _, menu := range sysMenu.Children {
|
||||||
|
|||||||
@@ -71,11 +71,11 @@ func (r *RepoSysRole) SelectRolePage(query map[string]any) map[string]any {
|
|||||||
params = append(params, v)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["roleName"]; ok && 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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["roleKey"]; ok && 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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["status"]; ok && 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)
|
params = append(params, sysRole.RoleID)
|
||||||
}
|
}
|
||||||
if sysRole.RoleKey != "" {
|
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)
|
params = append(params, sysRole.RoleKey)
|
||||||
}
|
}
|
||||||
if sysRole.RoleName != "" {
|
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)
|
params = append(params, sysRole.RoleName)
|
||||||
}
|
}
|
||||||
if sysRole.Status != "" {
|
if sysRole.Status != "" {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ func (r *RepoSysUser) SelectUserPage(query map[string]any) map[string]any {
|
|||||||
params = append(params, v)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["name"]; ok && 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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["status"]; ok && 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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["phonenumber"]; ok && 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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
beginTime, ok := query["beginTime"]
|
beginTime, ok := query["beginTime"]
|
||||||
@@ -219,11 +219,11 @@ func (r *RepoSysUser) SelectAllocatedPage(query map[string]any) map[string]any {
|
|||||||
var conditions []string
|
var conditions []string
|
||||||
var params []any
|
var params []any
|
||||||
if v, ok := query["name"]; ok && v != "" {
|
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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["phone"]; ok && 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)
|
params = append(params, v)
|
||||||
}
|
}
|
||||||
if v, ok := query["status"]; ok && 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)
|
params = append(params, sysUser.Status)
|
||||||
}
|
}
|
||||||
if sysUser.Phone != "" {
|
if sysUser.Phone != "" {
|
||||||
conditions = append(conditions, "u.phone like concat(?, '%')")
|
conditions = append(conditions, "u.phone like concat('%', concat(?, '%'))")
|
||||||
params = append(params, sysUser.Phone)
|
params = append(params, sysUser.Phone)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user