fix: member 接口增加 q 请求参数

This commit is contained in:
zhangshuai
2024-09-06 10:07:35 +08:00
parent af7635d508
commit ac391799de
2 changed files with 10 additions and 5 deletions

View File

@@ -87,9 +87,8 @@ public class WorkspaceController {
} }
@GetMapping("/{workspaceId}/member") @GetMapping("/{workspaceId}/member")
public R getMember(@PathVariable String workspaceId) { public R getMember(@PathVariable String workspaceId, @RequestParam Map params) {
params.put("workspaceId", workspaceId);
Map params = T.MapUtil.builder("workspaceId", workspaceId).build();
List<WorkspaceMemberEntity> memberEntityList = workspaceMemberService.queryList(params); List<WorkspaceMemberEntity> memberEntityList = workspaceMemberService.queryList(params);
return R.ok().putData("records", memberEntityList); return R.ok().putData("records", memberEntityList);
} }

View File

@@ -19,6 +19,7 @@
<association property="user" columnPrefix="su_" javaType="net.geedge.asw.module.sys.entity.SysUserEntity"> <association property="user" columnPrefix="su_" javaType="net.geedge.asw.module.sys.entity.SysUserEntity">
<id property="id" column="id"/> <id property="id" column="id"/>
<result property="name" column="name"/> <result property="name" column="name"/>
<result property="userName" column="user_name"/>
</association> </association>
<association property="role" columnPrefix="sr_" javaType="net.geedge.asw.module.sys.entity.SysRoleEntity"> <association property="role" columnPrefix="sr_" javaType="net.geedge.asw.module.sys.entity.SysRoleEntity">
@@ -40,6 +41,7 @@
cu.user_name AS cu_user_name, cu.user_name AS cu_user_name,
su.id AS su_id, su.id AS su_id,
su.name AS su_name, su.name AS su_name,
su.user_name AS su_user_name,
sr.id AS sr_id, sr.id AS sr_id,
sr.name AS sr_name, sr.name AS sr_name,
ws.id AS w_id, ws.id AS w_id,
@@ -52,12 +54,16 @@
LEFT JOIN workspace ws ON wm.workspace_id = ws.id LEFT JOIN workspace ws ON wm.workspace_id = ws.id
<where> <where>
<if test="params.workspaceId != null and params.workspaceId != ''"> <if test="params.workspaceId != null and params.workspaceId != ''">
wm.workspace_id = #{params.workspaceId} AND wm.workspace_id = #{params.workspaceId}
</if> </if>
<if test="params.userId != null and params.userId != ''"> <if test="params.userId != null and params.userId != ''">
wm.user_id = #{params.userId} AND wm.user_id = #{params.userId}
</if> </if>
<if test="params.q != null and params.q != ''">
AND ( locate(#{params.q}, su.name) OR locate(#{params.q}, su.user_name) )
</if>
</where> </where>
</select> </select>
</mapper> </mapper>