Prechádzať zdrojové kódy

添加用户关联协议的用户分页列表

hxl13994548489 2 rokov pred
rodič
commit
2475aba10b

+ 17 - 0
src/main/java/com/ydtech/modules/admin/controller/SysUserLinkPtlAgreementController.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.admin.controller;
 
 
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.dto.SysUserDto;
 import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
 import com.ydtech.modules.admin.model.vo.SysUserBaseVO;
 import com.ydtech.modules.admin.model.vo.SysUserLinkPtlAgreementAddVo;
@@ -116,4 +117,20 @@ public class SysUserLinkPtlAgreementController extends BaseController {
         }
 
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/4/23 11:44
+     *  @Description: 查询所有的后线人员列表+分页
+     */
+    @PostMapping("findAllUserList")
+    @ApiOperation("查询所有的后线人员列表+分页")
+    public HttpResult<BasePageResult<SysUserBaseVO>> findUserList(@RequestBody SysUserDto sysUserDto) {
+        try{
+            BasePageResult<SysUserBaseVO> result = sysUserLinkPtlAgreementService.findUserListByPage(sysUserDto);
+            return HttpResult.ok("查询数据成功", result);
+        }catch (Exception e){
+            return HttpResult.error("查询错误"+e.getMessage());
+        }
+    }
 }

+ 7 - 0
src/main/java/com/ydtech/modules/admin/dao/SysUserMapper.java

@@ -227,6 +227,13 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      *  @Description: 通过用户id和角色ids查询机构ids
      */
     List<String> getDeptIdsByRoleIdsAndUserIds(@Param("userIds") List<String> agentUserIds, @Param("roleIds") List<String> roleIds);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/4/23 11:39
+     *  @Description: 查询后线人员+分页
+     */
+    Page<SysUserBaseVO> findUserListByPage(@Param("page") Page<SysUserBaseVO> page, @Param("user") SysUserDto sysUserDto);
 }
 
 

+ 8 - 0
src/main/java/com/ydtech/modules/admin/service/SysUserLinkPtlAgreementService.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.admin.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.admin.model.SysUser;
+import com.ydtech.modules.admin.model.dto.SysUserDto;
 import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
 import com.ydtech.modules.admin.model.po.SysUserLinkPtlAgreement;
 import com.ydtech.modules.admin.model.vo.SysUserBaseVO;
@@ -63,4 +64,11 @@ public interface SysUserLinkPtlAgreementService extends IService<SysUserLinkPtlA
      *  @Description: 创建后线人员绑定的协议数据
      */
     List<PtlAgreement> findAllPtlAgreementListByUserId(String userId);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/4/23 11:36
+     *  @Description: 查询后线人员+分页
+     */
+    BasePageResult<SysUserBaseVO> findUserListByPage(SysUserDto sysUserDto);
 }

+ 15 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysUserLinkPtlAgreementServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.admin.dao.SysUserLinkPtlAgreementMapper;
 import com.ydtech.modules.admin.dao.SysUserMapper;
 import com.ydtech.modules.admin.model.SysUser;
+import com.ydtech.modules.admin.model.dto.SysUserDto;
 import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
 import com.ydtech.modules.admin.model.po.SysUserLinkPtlAgreement;
 import com.ydtech.modules.admin.model.vo.SysUserBaseVO;
@@ -135,4 +136,18 @@ public class SysUserLinkPtlAgreementServiceImpl extends ServiceImpl<SysUserLinkP
         }
         return  list;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/4/23 11:43
+     *  @Description: 查询后线人员+分页
+     */
+    @Override
+    public BasePageResult<SysUserBaseVO> findUserListByPage(SysUserDto sysUserDto) {
+        Page<SysUserBaseVO> page = new Page<>(sysUserDto.getPageNum(),
+                sysUserDto.getPageSize());
+        Page<SysUserBaseVO> userPageResult = sysUserMapper.findUserListByPage(page, sysUserDto);
+        return  new BasePageResult<>(sysUserDto.getPageNum(), page.getSize(), userPageResult.getTotal(), page.getPages(),
+                userPageResult.getRecords());
+    }
 }

+ 33 - 0
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -535,4 +535,37 @@
         </if>
         GROUP BY sd2.id
     </select>
+
+    <select id="findUserListByPage" resultType="com.ydtech.modules.admin.model.vo.SysUserBaseVO">
+        SELECT
+            t1.id AS userId,
+            t1.NAME AS NAME,
+            t1.mobile AS mobile,
+            t1.`status` AS `status`,
+            t2.id AS deptId,
+            t2.`name` AS deptName,
+            sd2.id AS pDeptId,
+            sd2.`name` AS pDeptName
+        FROM
+            sys_user t1
+                LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
+                LEFT JOIN sys_dept sd2 ON sd2.id = t2.parent_id
+        WHERE
+            t1.`status` = 1
+          AND t1.id NOT LIKE '%M%'
+        <if test='user !=null  '>
+            <if test='user.name !=null and user.name!="" '>
+                and t1.name like CONCAT('%', #{user.name}, '%')
+            </if>
+            <if test='user.userId !=null and user.userId!="" '>
+                and t1.id = #{user.userId}
+            </if>
+            <if test='user.mobile !=null and user.mobile!=""  '>
+                and t1.mobile = #{user.mobile}
+            </if>
+            <if test='user.deptId !=null and user.deptId!=""  '>
+                and t2.id = #{user.deptId}
+            </if>
+        </if>
+    </select>
 </mapper>