diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java index e010957670..bb9589d5f8 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java @@ -16,6 +16,7 @@ import io.metersphere.system.dto.response.OrganizationProjectOptionsResponse; import io.metersphere.system.service.SystemProjectService; import io.metersphere.system.service.UserService; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; @@ -62,8 +63,10 @@ public class OrganizationLogController { @GetMapping("/user/list/{organizationId}") @Operation(summary = "系统设置-组织-日志-获取用户列表") @RequiresPermissions(PermissionConstants.ORGANIZATION_LOG_READ) - public List getLogUserList(@PathVariable(value = "organizationId") String organizationId) { - return userService.getUserListByOrgId(organizationId); + public List getLogUserList(@PathVariable(value = "organizationId") String organizationId, + @Schema(description = "查询关键字,根据邮箱和用户名查询") + @RequestParam(value = "keyword", required = false) String keyword) { + return userService.getUserListByOrgId(organizationId,keyword); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java index 4f05cf1e54..cdb6ab9c88 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java @@ -10,7 +10,7 @@ public interface ExtUserMapper { List getMemberOption(String sourceId); - List getUserListByOrgId(@Param("sourceId") String sourceId); + List getUserListByOrgId(@Param("sourceId") String sourceId, @Param("keyword") String keyword); List selectUserList(@Param("keyword") String keyword); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml index 2ceaf81510..ddc94b9ac5 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml @@ -18,6 +18,11 @@ LEFT JOIN user_role_relation urr ON u.id = urr.user_id WHERE urr.source_id = #{sourceId} and u.deleted = false + + and (LOCATE(#{keyword},name)>0 or LOCATE(#{keyword},email)>0) + + order by u.create_time desc + limit 100