Browse Source

添加新接口

wangtianteng 1 year ago
parent
commit
ed33a497c6

+ 7 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/UserInfoController.java

@@ -49,7 +49,13 @@ public class UserInfoController extends BaseController {
         //新加用户创建时间 用户地址的经纬度
         return R.ok(userInfoIPage);
     }
-
+    /**
+     * 查询用户信息列表
+     */
+    @PostMapping("/userList")
+    public R<IPage<UserInfo>> userList(@RequestBody BaseParam param) {
+        return R.ok(userInfoService.getUserInfoListNew(new Page<>(param.getCurrent(), param.getSize()), param.getName()));
+    }
 
     /**
      * 获取用户地址详情信息

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/UserInfoService.java

@@ -14,4 +14,7 @@ import com.ruoyi.system.domain.UserInfo;
 public interface UserInfoService  extends IService<UserInfo> {
 
     IPage<UserInfo> getUserInfoList(Page<UserInfo> page, String param);
+
+
+    IPage<UserInfo> getUserInfoListNew(Page<UserInfo> page, String param);
 }

+ 11 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserInfoServiceImpl.java

@@ -1,8 +1,11 @@
 package com.ruoyi.system.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.BasicLibrary;
 import com.ruoyi.system.domain.UserInfo;
 import com.ruoyi.system.mapper.UserInfoMapper;
 import com.ruoyi.system.service.UserInfoService;
@@ -21,4 +24,12 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
     public IPage<UserInfo> getUserInfoList(Page<UserInfo> page, String param) {
         return this.baseMapper.getUserInfoList(page,param);
     }
+
+    @Override
+    public IPage<UserInfo> getUserInfoListNew(Page<UserInfo> page, String param) {
+         LambdaQueryWrapper<UserInfo> queryWrapper =  new LambdaQueryWrapper<UserInfo>();
+         queryWrapper.like(StringUtils.isNotEmpty(param),UserInfo::getUserPhone,param);
+         queryWrapper.eq(UserInfo::getDelFlag,0);
+        return this.baseMapper.selectPage(page,queryWrapper);
+    }
 }