| | |
| | | @SaCheckPermission("system:dept:query") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysDeptVo>> optionselect(@RequestParam(required = false) Long[] deptIds) { |
| | | return R.ok(deptService.selectDeptByIds(List.of(deptIds))); |
| | | return R.ok(deptService.selectDeptByIds(deptIds == null ? null : List.of(deptIds))); |
| | | } |
| | | |
| | | } |
| | |
| | | @SaCheckPermission("system:post:query") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysPostVo>> optionselect(@RequestParam(required = false) Long[] postIds) { |
| | | return R.ok(postService.selectPostByIds(List.of(postIds))); |
| | | return R.ok(postService.selectPostByIds(postIds == null ? null : List.of(postIds))); |
| | | } |
| | | |
| | | } |
| | |
| | | @SaCheckPermission("system:role:query") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysRoleVo>> optionselect(@RequestParam(required = false) Long[] roleIds) { |
| | | return R.ok(roleService.selectRoleByIds(List.of(roleIds))); |
| | | return R.ok(roleService.selectRoleByIds(roleIds == null ? null : List.of(roleIds))); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysUserVo>> optionselect(@RequestParam(required = false) Long[] userIds, |
| | | @RequestParam(required = false) Long deptId) { |
| | | return R.ok(userService.selectUserByIds(List.of(userIds), deptId)); |
| | | return R.ok(userService.selectUserByIds(userIds == null ? null : List.of(userIds), deptId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper); |
| | | |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "dept_id"), |
| | | @DataColumn(key = "userName", value = "user_id") |
| | | }) |
| | | List<SysUserVo> selectUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper); |
| | | |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public List<SysRoleVo> selectRoleByIds(List<Long> roleIds) { |
| | | return baseMapper.selectRoleList(new LambdaQueryWrapper<SysRole>() |
| | | .select(SysRole::getRoleId, SysRole::getRoleName, SysRole::getRoleKey) |
| | | .eq(SysRole::getStatus, UserConstants.ROLE_NORMAL) |
| | | .in(CollUtil.isNotEmpty(roleIds), SysRole::getRoleId, roleIds)); |
| | | return baseMapper.selectRoleList(new QueryWrapper<SysRole>() |
| | | .eq("r.status", UserConstants.ROLE_NORMAL) |
| | | .in(CollUtil.isNotEmpty(roleIds), "r.role_id", roleIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<SysUserVo> selectUserByIds(List<Long> userIds, Long deptId) { |
| | | return baseMapper.selectVoList(new LambdaQueryWrapper<SysUser>() |
| | | return baseMapper.selectUserList(new LambdaQueryWrapper<SysUser>() |
| | | .select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName) |
| | | .eq(SysUser::getStatus, UserConstants.USER_NORMAL) |
| | | .eq(ObjectUtil.isNotNull(deptId), SysUser::getDeptId, deptId) |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectDeptList" resultMap="SysDeptResult"> |
| | | select * from sys_dept ${ew.getCustomSqlSegment} |
| | | select ${ew.getSqlSelect} from sys_dept ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="countDeptById" resultType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectPageUserList" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, |
| | | u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark |
| | | select ${ew.getSqlSelect} |
| | | from sys_user u |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectUserList" resultMap="SysUserResult"> |
| | | select ${ew.getSqlSelect} |
| | | from sys_user |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectUserExportList" resultMap="SysUserExportResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, |
| | | u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |