Java Code Examples for com.baomidou.mybatisplus.plugins.Page#setCurrent()
The following examples show how to use
com.baomidou.mybatisplus.plugins.Page#setCurrent() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicServiceTest.java From app-version with Apache License 2.0 | 6 votes |
@Test public void formatCreatedBy() throws Exception { EntityWrapper<CustomApi> wrapper = new EntityWrapper<>(); wrapper.and().eq("app_id", ThreadLocalUtils.USER_THREAD_LOCAL.get().getAppId()); wrapper.andNew().eq("id", 48); wrapper.andNew().eq("del_flag", 0); wrapper.orderBy("created_time", false); Page<CustomApi> pageEntity = new Page<>(); pageEntity.setSize(10); pageEntity.setCurrent(1); pageEntity.setRecords(customApiMapper.selectPage(pageEntity, wrapper)); logger.info("formatCreatedBy前:" + pageEntity.getRecords().toString()); basicService.formatCreatedBy(pageEntity.getRecords()); logger.info("formatCreatedBy后:" + pageEntity.getRecords().toString()); }
Example 2
Source File: ChannelServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult list(int page, int pageSize, EntityWrapper<Channel> wrapper) { Page<Channel> pageEntity = new Page<>(); pageEntity.setSize(pageSize); pageEntity.setCurrent(page); pageEntity.setRecords(channelMapper.selectPage(pageEntity, wrapper)); basicService.formatCreatedBy(pageEntity.getRecords()); return ServiceResult.ok(pageEntity); }
Example 3
Source File: AdminServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult listApp(int page, int pageSize, EntityWrapper<App> wrapper) { Page<App> pageEntity = new Page<>(); pageEntity.setSize(pageSize); pageEntity.setCurrent(page); pageEntity.setRecords(appMapper.selectPage(pageEntity, wrapper)); basicService.formatCreatedBy(pageEntity.getRecords()); return ServiceResult.ok(pageEntity); }
Example 4
Source File: AdminServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult listUser(int page, int pageSize, EntityWrapper<User> wrapper) { Page<User> pageEntity = new Page<>(); pageEntity.setSize(pageSize); pageEntity.setCurrent(page); pageEntity.setRecords(userMapper.selectPage(pageEntity, wrapper)); return ServiceResult.ok(pageEntity); }
Example 5
Source File: CustomApiServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult list(int page, int pageSize, EntityWrapper<CustomApi> wrapper) { Page<CustomApi> pageEntity = new Page<>(); pageEntity.setSize(pageSize); pageEntity.setCurrent(page); pageEntity.setRecords(customApiMapper.selectPage(pageEntity, wrapper)); basicService.formatCreatedBy(pageEntity.getRecords()); return ServiceResult.ok(pageEntity); }
Example 6
Source File: ApkServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult getApkPageWithChannelCode(int page, int pageSize, Integer versionId, String channelCode, String md5, Integer deliveryStatus) { AndroidVersion androidVersion = androidVersionMapper.selectById(versionId); if (androidVersion == null) { return ServiceResultConstants.VERSION_NOT_EXISTS; } Page<ApkExt> apkPage = new Page<>(); apkPage.setCurrent(page); apkPage.setSize(pageSize); apkPage.setRecords(apkMapper.selectApkWithChannelCode(apkPage, versionId, channelCode, md5, deliveryStatus)); basicService.formatCreatedBy(apkPage.getRecords()); return ServiceResult.ok(apkPage); }
Example 7
Source File: IosVersionServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult list(int page, int pageSize, EntityWrapper<IosVersion> wrapper) { Page<IosVersion> versionPage = new Page<>(); versionPage.setCurrent(page); versionPage.setSize(pageSize); versionPage.setRecords(iosVersionMapper.selectPage(versionPage, wrapper)); basicService.formatCreatedBy(versionPage.getRecords()); return ServiceResult.ok(versionPage); }
Example 8
Source File: AppServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult getAppListWithUserId(int page, int pageSize, String userId) { EntityWrapper<UserAppRel> entityWrapper = new EntityWrapper<>(); entityWrapper.and().eq("user_id", userId); Page<UserAppRel> userAppRelPage = new Page<>(); userAppRelPage.setCurrent(page); userAppRelPage.setSize(pageSize); userAppRelPage.setRecords(userAppRelMapper.selectPage(userAppRelPage, entityWrapper)); List<App> collect = userAppRelPage.getRecords().stream().map(mapper -> { Integer appId = mapper.getAppId(); App app = new App(); app.setId(appId); app.setDelFlag(0); return appMapper.selectOne(app); }).collect(Collectors.toList()); collect.removeAll(Collections.singleton(null)); Page<App> appPage = new Page<>(); try { $.bean.copyProperties(appPage, userAppRelPage); appPage.setRecords(collect); return ServiceResult.ok(appPage); } catch (InvocationTargetException | IllegalAccessException e) { logger.error("App参数转换出错", e); } return ServiceResultConstants.ERROR_500; }
Example 9
Source File: OperationRecordLogServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult list(int page, int pageSize, EntityWrapper<OperationRecordLog> wrapper) { Page<OperationRecordLog> pageEntity = new Page<>(); pageEntity.setSize(pageSize); pageEntity.setCurrent(page); pageEntity.setRecords(operationRecordLogMapper.selectPage(pageEntity, wrapper)); basicService.formatCreatedBy(pageEntity.getRecords()); return ServiceResult.ok(pageEntity); }
Example 10
Source File: OperationRecordLogServiceImpl.java From app-version with Apache License 2.0 | 5 votes |
@Override public ServiceResult getListByQuery(int page, int pageSize, String phone, String nickName, Integer appId, String operationResource, String operationDescription, String operationType, String startDate, String endDate) { Page<OperationRecordLogExt> logPage = new Page<>(); logPage.setCurrent(page); logPage.setSize(pageSize); List<OperationRecordLogExt> list = operationRecordLogMapper.selectLogExtByQuery(logPage, phone, nickName, appId, operationResource, operationDescription, operationType, startDate, endDate); logPage.setRecords(list); return ServiceResult.ok(logPage); }
Example 11
Source File: OperationRecordLogMapperTest.java From app-version with Apache License 2.0 | 5 votes |
@Test public void selectLogExtByQuery() throws Exception { Page<OperationRecordLogExt> page = new Page<>(); page.setCurrent(1); page.setSize(10); String endDate = "2018-06-27 19:10:27"; List list = operationRecordLogMapper.selectLogExtByQuery(page, null, null, null, null, null, null,null,endDate); logger.info("size: " + list.size()); list = operationRecordLogMapper.selectLogExtByQuery(page, "", "", null, "", null, "",null,null); logger.info("size: " + list.size()); }
Example 12
Source File: BaseCrudController.java From Ffast-Java with MIT License | 5 votes |
/** * 查询 * * @param m * @param page * @param simple 只查少数字段 * @return */ @ResponseBody @RequestMapping(value = "/list") @Permission(value = "list") public ServiceResult list(T m, Integer pageSize, Integer page, Boolean simple, String sortField, String sortOrder) { ServiceResult beforeResult = listBefore(m); if (beforeResult != null) { return beforeResult; } // 查询字段 String[] properties = ((simple != null && simple) ? getSimpleProperties() : getProperties()); Page<T> pageM = new Page<T>(); if (pageSize == null || page == null) { pageSize = 1000; page = 0; } // 排序相关 if (sortOrder != null) { pageM.setAsc("asc".equals(sortOrder)); } else { pageM.setAsc(isAsc()); } if (sortField == null) { sortField = getSortField(); } pageM.setOrderByField(sortField); pageM.setCurrent(page); pageM.setSize(pageSize); return getService().findListByPage(m, pageM); }