| | |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "用户名", dataType = "String", paramType = "query", example = "室"), |
| | | @ApiImplicitParam(name = "depid", value = "单位ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<UserEntity>> selectByPageAndCount(String uname, Integer depid, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<UserEntity>> selectByPageAndCount(String uname, String depcode, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | int count = userService.selectCount(uname, depid); |
| | | int count = userService.selectCount(uname, depcode); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectByPage(uname, depid, pageSize, pageSize * (pageIndex - 1)); |
| | | List<UserEntity> rs = userService.selectByPage(uname, depcode, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "用户名", dataType = "String", paramType = "query", example = "室"), |
| | | @ApiImplicitParam(name = "roleid", value = "角色ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "depid", value = "单位ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<UserEntity>> selectByPageForRole(String uname, Integer roleid, Integer depid, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<UserEntity>> selectByPageForRole(String uname, Integer roleid, String depcode, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | int count = userService.selectCountForRole(uname, roleid, depid); |
| | | int count = userService.selectCountForRole(uname, roleid, depcode); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectByPageForRole(uname, roleid, depid, pageSize, pageSize * (pageIndex - 1)); |
| | | List<UserEntity> rs = userService.selectByPageForRole(uname, roleid, depcode, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = userService.updateUsers(entity); |
| | | int count = userService.updateUser(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |