com.baomidou.mybatisplus.core.metadata.IPage Java Examples

The following examples show how to use com.baomidou.mybatisplus.core.metadata.IPage. 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: UserController.java    From zuihou-admin-cloud with Apache License 2.0 6 votes vote down vote up
/**
 * 分页、导出、导出预览 方法的共用查询条件
 *
 * @param params
 * @param page
 * @param defSize
 */
@Override
public void query(PageParams<UserPageDTO> params, IPage<User> page, Long defSize) {
    UserPageDTO userPage = params.getModel();

    QueryWrap<User> wrap = Wraps.q();
    handlerWrapper(wrap, params);

    LbqWrapper<User> wrapper = wrap.lambda();
    if (userPage.getOrg() != null && RemoteData.getKey(userPage.getOrg(), 0L) > 0) {
        List<Org> children = orgService.findChildren(Arrays.asList(userPage.getOrg().getKey()));
        wrapper.in(User::getOrg, children.stream().map((org) -> new RemoteData(org.getId())).collect(Collectors.toList()));
    }
    wrapper.like(User::getName, userPage.getName())
            .like(User::getAccount, userPage.getAccount())
            .like(User::getEmail, userPage.getEmail())
            .like(User::getMobile, userPage.getMobile())
            .eq(User::getStation, userPage.getStation())
            .eq(User::getPositionStatus, userPage.getPositionStatus())
            .eq(User::getEducation, userPage.getEducation())
            .eq(userPage.getNation() != null && StrUtil.isNotEmpty(userPage.getNation().getKey()), User::getNation, userPage.getNation())
            .eq(User::getSex, userPage.getSex())
            .eq(User::getStatus, userPage.getStatus());
    baseService.findPage(page, wrapper);
}
 
Example #2
Source File: RegisterCenterServiceImpl.java    From Moss with Apache License 2.0 6 votes vote down vote up
@Override
public PageResult<RegisterCenterModel> findPageByParam(RegisterCenterPageRequest model) {
    PageResult<RegisterCenterModel> pageResult= new PageResult<RegisterCenterModel>();
    Page pageRequest = new Page(model.getPageNo(),model.getPageSize());
    QueryWrapper<RegisterCenter> queryWrapper = new QueryWrapper<>();
    if(StringUtils.isNotEmpty(model.getCode())){
        queryWrapper.like("code",model.getCode());
    }
    queryWrapper.eq("is_deleted",Constants.IS_DELETE_FALSE);
    IPage<RegisterCenter> page=registerCenterMapper.selectPage(pageRequest, queryWrapper);
    List<RegisterCenterModel> list= BeanMapper.mapList(page.getRecords(),RegisterCenter.class,RegisterCenterModel.class);
    pageResult.setCurrentPage(page.getCurrent());
    pageResult.setTotalCount(page.getTotal());
    pageResult.setList(list);
    pageResult.setTotalPage(page.getSize());
    return pageResult;
}
 
Example #3
Source File: BlogServiceImpl.java    From mogu_blog_v2 with Apache License 2.0 6 votes vote down vote up
@Override
public IPage<Blog> getListByBlogSortUid(String blogSortUid, Long currentPage, Long pageSize) {
    //分页
    Page<Blog> page = new Page<>();
    page.setCurrent(currentPage);
    page.setSize(pageSize);

    QueryWrapper<Blog> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq(SQLConf.STATUS, EStatus.ENABLE);
    queryWrapper.orderByDesc(SQLConf.CREATE_TIME);
    queryWrapper.eq(BaseSQLConf.IS_PUBLISH, EPublish.PUBLISH);
    queryWrapper.eq(SQLConf.BLOG_SORT_UID, blogSortUid);

    //因为首页并不需要显示内容,所以需要排除掉内容字段
    queryWrapper.select(Blog.class, i -> !i.getProperty().equals(SQLConf.CONTENT));
    IPage<Blog> pageList = blogService.page(page, queryWrapper);

    //给博客增加标签和分类
    List<Blog> list = blogService.setTagAndSortByBlogList(pageList.getRecords());
    pageList.setRecords(list);
    return pageList;
}
 
Example #4
Source File: TagsServiceImpl.java    From plumemo with Apache License 2.0 6 votes vote down vote up
@Override
public Result<TagsVO> getTagsList(TagsVO tagsVO) {

    List<TagsVO> tagsList = new ArrayList<>();
    if (tagsVO == null || tagsVO.getPage() == null || tagsVO.getSize() == null) {
        List<Tags> records = this.tagsDao.selectList(new LambdaQueryWrapper<Tags>().orderByDesc(Tags::getId));
        if (!CollectionUtils.isEmpty(records)) {
            records.forEach(tags -> {
                tagsList.add(new TagsVO().setId(tags.getId()).setName(tags.getName()));
            });
        }
        return Result.createWithModels(tagsList);
    }
    LambdaQueryWrapper<Tags> tagsLambdaQueryWrapper = new LambdaQueryWrapper<Tags>();
    if (StringUtils.isNotBlank(tagsVO.getKeywords())){
        tagsLambdaQueryWrapper.like(Tags::getName, tagsVO.getKeywords());
    }
    if (StringUtils.isNotBlank(tagsVO.getName())){
        tagsLambdaQueryWrapper.eq(Tags::getName, tagsVO.getName());
    }
    Page page = PageUtil.checkAndInitPage(tagsVO);
    IPage<TagsVO> tagsIPage = this.tagsDao.selectPage(page,tagsLambdaQueryWrapper.orderByDesc(Tags::getId));
    return Result.createWithPaging(tagsIPage.getRecords(), PageUtil.initPageInfo(page));
}
 
Example #5
Source File: AppServiceImpl.java    From Moss with Apache License 2.0 6 votes vote down vote up
/**
 * 根据查询条件查询App并分页
 * @param appPageRequest
 * @return
 */
@Override
public PageResult<AppModel> findByPageVague(AppPageRequest appPageRequest) {
    Page pageRequest = new Page(appPageRequest.getPageNo(), appPageRequest.getPageSize());
    QueryWrapper<App> queryWrapper = new QueryWrapper<>();
    if(StringUtils.isNotEmpty(appPageRequest.getProjectName())){
        queryWrapper.like("project_name", appPageRequest.getProjectName());
    }
    if(StringUtils.isNotEmpty(appPageRequest.getStatus())){
        queryWrapper.eq("status",Integer.valueOf(appPageRequest.getStatus()).intValue());
    }
    if(StringUtils.isNotEmpty(appPageRequest.getName())){
        queryWrapper.like("app_id", appPageRequest.getName().toLowerCase());
    }
    if(StringUtils.isNotEmpty(appPageRequest.getTakeOver())){
        queryWrapper.eq("take_over",Long.valueOf(appPageRequest.getTakeOver()).intValue());
    }
    IPage<App> page=appMapper.selectPage(pageRequest, queryWrapper);
    List<AppModel> list= BeanMapper.mapList(page.getRecords(),App.class,AppModel.class);
    PageResult<AppModel> pageResult=new PageResult<AppModel>();
    pageResult.setCurrentPage(page.getCurrent());
    pageResult.setTotalCount(page.getTotal());
    pageResult.setList(list);
    pageResult.setTotalPage(page.getSize());
    return pageResult;
}
 
Example #6
Source File: SysDictTypeServiceImpl.java    From mogu_blog_v2 with Apache License 2.0 6 votes vote down vote up
@Override
public IPage<SysDictType> getPageList(SysDictTypeVO sysDictTypeVO) {
    QueryWrapper<SysDictType> queryWrapper = new QueryWrapper<>();

    // 字典名称
    if (StringUtils.isNotEmpty(sysDictTypeVO.getDictName()) && !StringUtils.isEmpty(sysDictTypeVO.getDictName().trim())) {
        queryWrapper.like(SQLConf.DICT_NAME, sysDictTypeVO.getDictName().trim());
    }

    // 字典类型
    if (StringUtils.isNotEmpty(sysDictTypeVO.getDictType()) && !StringUtils.isEmpty(sysDictTypeVO.getDictType().trim())) {
        queryWrapper.like(SQLConf.DICT_TYPE, sysDictTypeVO.getDictType().trim());
    }

    Page<SysDictType> page = new Page<>();
    page.setCurrent(sysDictTypeVO.getCurrentPage());
    page.setSize(sysDictTypeVO.getPageSize());
    queryWrapper.eq(SQLConf.STATUS, EStatus.ENABLE);
    queryWrapper.orderByDesc(SQLConf.SORT, SQLConf.CREATE_TIME);
    IPage<SysDictType> pageList = sysDictTypeService.page(page, queryWrapper);
    return pageList;
}
 
Example #7
Source File: SysUserServiceImpl.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
@Override
public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page) {
	List<SysUserSysDepartModel> list = baseMapper.getUserByOrgCode(page, orgCode, userParams);
	Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams);

	IPage<SysUserSysDepartModel> result = new Page<>(page.getCurrent(), page.getSize(), total);
	result.setRecords(list);

	return result;
}
 
Example #8
Source File: BlogServiceImpl.java    From mogu_blog_v2 with Apache License 2.0 5 votes vote down vote up
@Override
public IPage<Blog> searchBlogByTag(String tagUid, Long currentPage, Long pageSize) {
    Tag tag = tagService.getById(tagUid);
    if (tag != null) {
        HttpServletRequest request = RequestHolder.getRequest();
        String ip = IpUtils.getIpAddr(request);
        //从Redis取出数据,判断该用户24小时内,是否点击过该标签
        String jsonResult = redisUtil.get(RedisConf.TAG_CLICK + RedisConf.SEGMENTATION + ip + "#" + tagUid);
        if (StringUtils.isEmpty(jsonResult)) {

            //给标签点击数增加
            int clickCount = tag.getClickCount() + 1;
            tag.setClickCount(clickCount);
            tag.updateById();
            //将该用户点击记录存储到redis中, 24小时后过期
            redisUtil.setEx(RedisConf.TAG_CLICK + RedisConf.SEGMENTATION + ip + RedisConf.WELL_NUMBER + tagUid, clickCount + "",
                    24, TimeUnit.HOURS);
        }
    }
    QueryWrapper<Blog> queryWrapper = new QueryWrapper<>();
    Page<Blog> page = new Page<>();
    page.setCurrent(currentPage);
    page.setSize(pageSize);

    queryWrapper.like(SQLConf.TagUid, tagUid);
    queryWrapper.eq(SQLConf.STATUS, EStatus.ENABLE);
    queryWrapper.eq(BaseSQLConf.IS_PUBLISH, EPublish.PUBLISH);
    queryWrapper.orderByDesc(SQLConf.CREATE_TIME);
    queryWrapper.select(Blog.class, i -> !i.getProperty().equals(SysConf.CONTENT));
    IPage<Blog> pageList = blogService.page(page, queryWrapper);
    List<Blog> list = pageList.getRecords();
    list = blogService.setTagAndSortAndPictureByBlogList(list);
    pageList.setRecords(list);
    return pageList;
}
 
Example #9
Source File: MyBatisAccessor.java    From jstarcraft-core with Apache License 2.0 5 votes vote down vote up
@Override
public <K extends Comparable, T extends IdentityObject<K>> void iterateUnion(StorageIterator<T> iterator, Class<T> clazz, Map<String, Object> condition, StoragePagination pagination) {
	MyBatisMetadata metadata = metadatas.get(clazz);
	BaseMapper mapper = template.getMapper(metadata.getMapperClass());
	QueryWrapper<?> query = new QueryWrapper<>();
	for (Entry<String, Object> term : condition.entrySet()) {
		query.or((wrapper) -> {
			return wrapper.eq(metadata.getColumnName(term.getKey()), term.getValue());
		});
	}
	IPage<T> page = mapper.selectPage(new Page(pagination.getPage(), pagination.getSize()), query);
	for (T object : page.getRecords()) {
		iterator.iterate(object);
	}
}
 
Example #10
Source File: OptLogController.java    From zuihou-admin-boot with Apache License 2.0 5 votes vote down vote up
@Override
@ApiOperation(value = "分页列表查询")
@PostMapping(value = "/page")
@PreAuth("hasPermit('{}view')")
public R<IPage<OptLog>> page(@RequestBody @Validated PageParams<OptLog> params) {
    return super.page(params);
}
 
Example #11
Source File: ProdController.java    From mall4j with GNU Affero General Public License v3.0 5 votes vote down vote up
@GetMapping("/moreBuyProdList")
@ApiOperation(value = "每日疯抢", notes = "获取销量最多的商品列表")
@ApiImplicitParams({})
public ResponseEntity<IPage<ProductDto>> moreBuyProdList(PageParam<ProductDto> page) {
    IPage<ProductDto> productDtoIPage = prodService.moreBuyProdList(page);
    return ResponseEntity.ok(productDtoIPage);
}
 
Example #12
Source File: LayuiPageFactory.java    From Guns with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * 创建layui能识别的分页响应参数
 *
 * @author fengshuonan
 * @Date 2019/1/25 22:14
 */
public static LayuiPageInfo createPageInfo(IPage page) {
    LayuiPageInfo result = new LayuiPageInfo();
    result.setCount(page.getTotal());
    result.setData(page.getRecords());
    return result;
}
 
Example #13
Source File: SysCheckRuleController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 分页列表查询
 *
 * @param sysCheckRule
 * @param pageNo
 * @param pageSize
 * @param request
 * @return
 */
@AutoLog(value = "编码校验规则-分页列表查询")
@ApiOperation(value = "编码校验规则-分页列表查询", notes = "编码校验规则-分页列表查询")
@GetMapping(value = "/list")
public Result queryPageList(
        SysCheckRule sysCheckRule,
        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
        HttpServletRequest request
) {
    QueryWrapper<SysCheckRule> queryWrapper = QueryGenerator.initQueryWrapper(sysCheckRule, request.getParameterMap());
    Page<SysCheckRule> page = new Page<>(pageNo, pageSize);
    IPage<SysCheckRule> pageList = sysCheckRuleService.page(page, queryWrapper);
    return Result.ok(pageList);
}
 
Example #14
Source File: TableServiceImpl.java    From kvf-admin with MIT License 5 votes vote down vote up
@Override
public IPage<TableDTO> listTablePage(String tableName, int current, int size) {
    Page<TableDTO> page = new Page<>(current, size);
    List<TableDTO> tableDTOS;
    if (StrUtil.isBlank(tableName)) {
        tableDTOS = tableMapper.listTable(page);
    } else {
        tableDTOS = tableMapper.listTableByName(tableName, page);
    }
    return page.setRecords(tableDTOS);
}
 
Example #15
Source File: SysDataSourceController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 分页列表查询
 *
 * @param sysDataSource
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@AutoLog(value = "多数据源管理-分页列表查询")
@ApiOperation(value = "多数据源管理-分页列表查询", notes = "多数据源管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(
        SysDataSource sysDataSource,
        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
        HttpServletRequest req
) {
    QueryWrapper<SysDataSource> queryWrapper = QueryGenerator.initQueryWrapper(sysDataSource, req.getParameterMap());
    Page<SysDataSource> page = new Page<>(pageNo, pageSize);
    IPage<SysDataSource> pageList = sysDataSourceService.page(page, queryWrapper);
    return Result.ok(pageList);
}
 
Example #16
Source File: SysFileController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 分页列表查询
 *
 * @param sysFile
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@AutoLog(value = "文件管理-分页列表查询")
@ApiOperation(value="文件管理-分页列表查询", notes="文件管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(SysFile sysFile,
							   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
							   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
							   HttpServletRequest req) {
	QueryWrapper<SysFile> queryWrapper = QueryGenerator.initQueryWrapper(sysFile, req.getParameterMap());
	Page<SysFile> page = new Page<SysFile>(pageNo, pageSize);
	IPage<SysFile> pageList = sysFileService.page(page, queryWrapper);
	return Result.ok(pageList);
}
 
Example #17
Source File: NoticeController.java    From mall4j with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 分页查询
 *
 * @param page   分页对象
 * @param notice 公告管理
 * @return 分页数据
 */
@GetMapping("/page")
public ResponseEntity<IPage<Notice>> getNoticePage(PageParam<Notice> page, Notice notice) {
    IPage<Notice> noticeIPage = noticeService.page(page, new LambdaQueryWrapper<Notice>()
            .eq(notice.getStatus() != null, Notice::getStatus, notice.getStatus())
            .like(notice.getTitle() != null, Notice::getTitle, notice.getTitle()).orderByDesc(Notice::getUpdateTime));
    return ResponseEntity.ok(noticeIPage);
}
 
Example #18
Source File: BaseRoleServiceImpl.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * 分页查询
 *
 * @param pageParams
 * @return
 */
@Override
public IPage<BaseRole> findListPage(PageParams pageParams) {
    BaseRole query = pageParams.mapToObject(BaseRole.class);
    QueryWrapper<BaseRole> queryWrapper = new QueryWrapper();
    queryWrapper.lambda()
            .likeRight(ObjectUtils.isNotEmpty(query.getRoleCode()),BaseRole::getRoleCode, query.getRoleCode())
            .likeRight(ObjectUtils.isNotEmpty(query.getRoleName()),BaseRole::getRoleName, query.getRoleName());
    queryWrapper.orderByDesc("create_time");
    return baseRoleMapper.selectPage(pageParams,queryWrapper);
}
 
Example #19
Source File: JoaDemoController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
  * 分页列表查询
 * @param joaDemo
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@GetMapping(value = "/list")
public Result<IPage<JoaDemo>> queryPageList(JoaDemo joaDemo,
								  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
								  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
								  HttpServletRequest req) {
	Result<IPage<JoaDemo>> result = new Result<IPage<JoaDemo>>();
	QueryWrapper<JoaDemo> queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, req.getParameterMap());
	Page<JoaDemo> page = new Page<JoaDemo>(pageNo, pageSize);
	IPage<JoaDemo> pageList = joaDemoService.page(page, queryWrapper);
	result.setSuccess(true);
	result.setResult(pageList);
	return result;
}
 
Example #20
Source File: MsgsCenterInfoController.java    From zuihou-admin-boot with Apache License 2.0 5 votes vote down vote up
/**
 * 预览Excel
 *
 * @param params 预览参数
 * @return
 */
@ApiOperation(value = "预览Excel")
@SysLog("'预览Excel:' + (#params.map[" + NormalExcelConstants.FILE_NAME + "]?:'')")
@RequestMapping(value = "/preview", method = RequestMethod.POST)
public R<String> preview(@RequestBody @Validated PageParams<MsgsCenterInfoQueryDTO> params) {
    IPage<MsgsCenterInfoPageResultDTO> page = params.getPage();
    ExportParams exportParams = getExportParams(params, page);

    Workbook workbook = ExcelExportUtil.exportExcel(exportParams, MsgsCenterInfoPageResultDTO.class, page.getRecords());
    return R.success(ExcelXorHtmlUtil.excelToHtml(new ExcelToHtmlParams(workbook)));
}
 
Example #21
Source File: UserController.java    From SpringBlade with Apache License 2.0 5 votes vote down vote up
/**
 * 用户列表
 */
@GetMapping("/list")
@ApiImplicitParams({
	@ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
	@ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
})
@ApiOperationSupport(order = 3)
@ApiOperation(value = "列表", notes = "传入account和realName")
public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) {
	QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
	IPage<User> pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper);
	return R.data(UserWrapper.build().pageVO(pages));
}
 
Example #22
Source File: SysUserServiceImpl.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
@Override
public IPage<SysUser> getUserByDepartIdAndQueryWrapper(Page<SysUser> page, String departId, QueryWrapper<SysUser> queryWrapper) {
	LambdaQueryWrapper<SysUser> lambdaQueryWrapper = queryWrapper.lambda();

	lambdaQueryWrapper.eq(SysUser::getDelFlag, "0");
       lambdaQueryWrapper.inSql(SysUser::getId, "SELECT user_id FROM sys_user_depart WHERE dep_id = '" + departId + "'");

       return userMapper.selectPage(page, lambdaQueryWrapper);
}
 
Example #23
Source File: BaseServiceImpl.java    From hdw-dubbo with Apache License 2.0 5 votes vote down vote up
public PageVo pageList(CommonDTO commonDTO) {
    Page page = new Page();
    // 设置当前页码
    page.setCurrent(commonDTO.getPage());
    // 设置页大小
    page.setSize(commonDTO.getLimit());
    IPage iPage = this.baseMapper.pageList(page, commonDTO);
    return new PageVo(iPage);

}
 
Example #24
Source File: JeecgOrderTabMainController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * 通过id查询
 *
 * @param jeecgOrderCustomer
 * @return
 */
@GetMapping(value = "/listOrderCustomerByMainId")
public Result<?> queryOrderCustomerListByMainId(JeecgOrderCustomer jeecgOrderCustomer,
                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                HttpServletRequest req) {
    QueryWrapper<JeecgOrderCustomer> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderCustomer, req.getParameterMap());
    Page<JeecgOrderCustomer> page = new Page<JeecgOrderCustomer>(pageNo, pageSize);
    IPage<JeecgOrderCustomer> pageList = jeecgOrderCustomerService.page(page, queryWrapper);
    return Result.ok(pageList);
}
 
Example #25
Source File: SysFillRuleController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 分页列表查询
 *
 * @param sysFillRule
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@AutoLog(value = "填值规则-分页列表查询")
@ApiOperation(value = "填值规则-分页列表查询", notes = "填值规则-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(SysFillRule sysFillRule,
                               @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                               @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                               HttpServletRequest req) {
    QueryWrapper<SysFillRule> queryWrapper = QueryGenerator.initQueryWrapper(sysFillRule, req.getParameterMap());
    Page<SysFillRule> page = new Page<>(pageNo, pageSize);
    IPage<SysFillRule> pageList = sysFillRuleService.page(page, queryWrapper);
    return Result.ok(pageList);
}
 
Example #26
Source File: MsgsCenterInfoController.java    From zuihou-admin-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 构建导出参数
 *
 * @param params 分页参数
 * @param page
 * @return
 */
private ExportParams getExportParams(PageParams<MsgsCenterInfoQueryDTO> params, IPage<MsgsCenterInfoPageResultDTO> page) {
    query(params, page);

    String title = params.getMap().get("title");
    String type = params.getMap().getOrDefault("type", ExcelType.XSSF.name());
    String sheetName = params.getMap().getOrDefault("sheetName", "SheetName");

    ExcelType excelType = ExcelType.XSSF.name().equals(type) ? ExcelType.XSSF : ExcelType.HSSF;
    return new ExportParams(title, sheetName, excelType);
}
 
Example #27
Source File: CategoryServiceImpl.java    From plumemo with Apache License 2.0 5 votes vote down vote up
@Override
public Result statisticsList(CategoryVO categoryVO) {
    Page page = Optional.of(PageUtil.checkAndInitPage(categoryVO)).orElse(PageUtil.initPage());
    LambdaQueryWrapper<CategoryVO> categoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
    if (StringUtils.isNotBlank(categoryVO.getKeywords())) {
        categoryLambdaQueryWrapper.like(CategoryVO::getName, categoryVO.getKeywords());
    }
    IPage<CategoryVO> categoryVOList = this.categoryDao.selectStatistics(page,categoryLambdaQueryWrapper);
    return Result.createWithPaging(categoryVOList.getRecords(), PageUtil.initPageInfo(page));
}
 
Example #28
Source File: ProdController.java    From mall4j with GNU Affero General Public License v3.0 5 votes vote down vote up
@GetMapping("/lastedProdPage")
@ApiOperation(value = "新品推荐", notes = "获取新品推荐商品列表")
@ApiImplicitParams({
})
public ResponseEntity<IPage<ProductDto>> lastedProdPage(PageParam<ProductDto> page) {
    IPage<ProductDto> productDtoIPage = prodService.pageByPutawayTime(page);
    return ResponseEntity.ok(productDtoIPage);
}
 
Example #29
Source File: UserServiceImpl.java    From permission with MIT License 5 votes vote down vote up
/**
 * 加载用户角色
 * @param page
 */
private void findUserRoles(IPage page) {
    List<?> content = page.getRecords();
    for(Object object:content) {
        SysUser sysUser = (SysUser) object;
        List<SysUserRole> userRoles = findUserRoles(sysUser.getId());
        sysUser.setUserRoles(userRoles);
        sysUser.setRoleNames(getRoleNames(userRoles));
        SysDept dept = deptMapper.selectById(sysUser.getDeptId());
        if (dept != null) {
            sysUser.setDeptName(dept.getName());
        }
    }
}
 
Example #30
Source File: SysFillRuleController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 分页列表查询
 *
 * @param sysFillRule
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@AutoLog(value = "填值规则-分页列表查询")
@ApiOperation(value = "填值规则-分页列表查询", notes = "填值规则-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(SysFillRule sysFillRule,
                               @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                               @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                               HttpServletRequest req) {
    QueryWrapper<SysFillRule> queryWrapper = QueryGenerator.initQueryWrapper(sysFillRule, req.getParameterMap());
    Page<SysFillRule> page = new Page<>(pageNo, pageSize);
    IPage<SysFillRule> pageList = sysFillRuleService.page(page, queryWrapper);
    return Result.ok(pageList);
}