排队管理-用户搜索
This commit is contained in:
parent
707b8b0a5b
commit
f2cbf3f282
@ -8,6 +8,7 @@ import com.yzt.common.response.TopDetail;
|
||||
import com.yzt.common.response.UserBrokerageRecordResponse;
|
||||
import com.yzt.common.response.UserCenterResponse;
|
||||
import com.yzt.common.response.UserResponse;
|
||||
import com.yzt.common.response.UserSearchAdminResponse;
|
||||
import com.yzt.common.result.CommonResult;
|
||||
import com.yzt.service.service.UserBrokerageRecordService;
|
||||
import com.yzt.service.service.UserService;
|
||||
@ -234,6 +235,17 @@ public class UserController {
|
||||
}
|
||||
return CommonResult.failed("更新失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理用户搜索:通过手机号或企业名称模糊查询
|
||||
* @param keyword 搜索关键字(手机号码或企业名称)
|
||||
*/
|
||||
@ApiOperation(value = "用户搜索(手机号/企业名称)")
|
||||
@RequestMapping(value = "/search", method = RequestMethod.GET)
|
||||
public CommonResult<List<UserSearchAdminResponse>> searchUsers(@RequestParam(value = "keyword", required = false) String keyword) {
|
||||
List<UserSearchAdminResponse> userList = userService.searchUsersByKeyword(keyword);
|
||||
return CommonResult.success(userList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package com.yzt.common.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 后台管理用户搜索响应体
|
||||
*/
|
||||
@Data
|
||||
public class UserSearchAdminResponse {
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "客户名称")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String tenantName;
|
||||
}
|
||||
@ -2,7 +2,9 @@ package com.yzt.service.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yzt.common.model.user.User;
|
||||
import com.yzt.common.response.UserSearchAdminResponse;
|
||||
import com.yzt.common.response.UserSpreadPeopleItemResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -16,4 +18,11 @@ public interface UserMapper extends BaseMapper<User> {
|
||||
List<UserSpreadPeopleItemResponse> getSpreadPeopleList(Map<String, Object> map);
|
||||
|
||||
List<User> findAdminList(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 后台管理用户搜索:通过手机号或企业名称模糊查询
|
||||
* @param keyword 搜索关键字
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<UserSearchAdminResponse> searchUsersByPhoneOrTenant(@Param("keyword") String keyword);
|
||||
}
|
||||
|
||||
@ -371,4 +371,11 @@ public interface UserService extends IService<User> {
|
||||
*/
|
||||
User getReferInfo();
|
||||
|
||||
/**
|
||||
* 后台管理用户搜索:通过手机号或企业名称模糊查询
|
||||
* @param keyword 搜索关键字
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<UserSearchAdminResponse> searchUsersByKeyword(String keyword);
|
||||
|
||||
}
|
||||
|
||||
@ -1998,6 +1998,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
return update(luw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理用户搜索:通过手机号或企业名称模糊查询
|
||||
* @param keyword 搜索关键字
|
||||
* @return 用户列表
|
||||
*/
|
||||
@Override
|
||||
public List<UserSearchAdminResponse> searchUsersByKeyword(String keyword) {
|
||||
return userMapper.searchUsersByPhoneOrTenant(keyword);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -95,4 +95,23 @@
|
||||
</if>
|
||||
ORDER BY u.uid desc
|
||||
</select>
|
||||
|
||||
<!-- 后台管理用户搜索:通过手机号或企业名称模糊查询 -->
|
||||
<select id="searchUsersByPhoneOrTenant" resultType="com.yzt.common.response.UserSearchAdminResponse" parameterType="String">
|
||||
SELECT
|
||||
u.uid,
|
||||
u.nickname,
|
||||
u.phone,
|
||||
t.tenant_name AS tenantName
|
||||
FROM fw_user AS u
|
||||
LEFT JOIN fw_tenant AS t ON u.tenant_id = t.tenant_id
|
||||
WHERE 1 = 1
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
u.phone LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR t.tenant_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
ORDER BY u.uid DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user