| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.sql.SqlUtil; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | |
| | | @ApiModelProperty(value = "排序的方向", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | /** |
| | | * 当前记录起始索引 默认值 |
| | | */ |
| | | public static final int DEFAULT_PAGE_NUM = 1; |
| | | |
| | | /** |
| | | * 每页显示记录数 默认值 默认查全部 |
| | | */ |
| | | public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE; |
| | | |
| | | public <T> Page<T> build() { |
| | | Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM); |
| | | Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE); |
| | | if (pageNum <= 0) { |
| | | pageNum = DEFAULT_PAGE_NUM; |
| | | } |
| | | Page<T> page = new Page<>(pageNum, pageSize); |
| | | OrderItem orderItem = buildOrderItem(); |
| | | if (ObjectUtil.isNotNull(orderItem)) { |
| | | page.addOrder(orderItem); |
| | | } |
| | | return page; |
| | | } |
| | | |
| | | private OrderItem buildOrderItem() { |
| | | // 兼容前端排序类型 |
| | | if ("ascending".equals(isAsc)) { |
| | | isAsc = "asc"; |
| | | } else if ("descending".equals(isAsc)) { |
| | | isAsc = "desc"; |
| | | } |
| | | if (StringUtils.isNotBlank(orderByColumn)) { |
| | | String orderBy = SqlUtil.escapeOrderBySql(orderByColumn); |
| | | orderBy = StringUtils.toUnderScoreCase(orderBy); |
| | | if ("asc".equals(isAsc)) { |
| | | return OrderItem.asc(orderBy); |
| | | } else if ("desc".equals(isAsc)) { |
| | | return OrderItem.desc(orderBy); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 分页查询VO |
| | | */ |
| | | default <V> IPage<V> selectVoPage(IPage<T> page, Wrapper<T> wrapper, Class<V> voClass) { |
| | | default <V, P extends IPage<V>> P selectVoPage(IPage<T> page, Wrapper<T> wrapper, Class<V> voClass) { |
| | | IPage<T> pageData = this.selectPage(page, wrapper); |
| | | IPage<V> voPage = new Page<>(pageData.getCurrent(), pageData.getSize(), pageData.getTotal()); |
| | | voPage.setRecords(BeanCopyUtils.copyList(pageData.getRecords(), voClass)); |
| | | return voPage; |
| | | return (P) voPage; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 翻页查询 |
| | | * @deprecated 3.6.0 移除 请使用 {@link #pageVo(IPage, Wrapper)} |
| | | */ |
| | | @Override |
| | | @Deprecated |
| | | public PagePlus<T, V> pageVo(PagePlus<T, V> page, Wrapper<T> queryWrapper) { |
| | | PagePlus<T, V> result = getBaseMapper().selectPage(page, queryWrapper); |
| | | List<V> volist = BeanCopyUtils.copyList(result.getRecords(), voClass); |
| | |
| | | * @param page 翻页对象 |
| | | * @param queryWrapper 实体对象封装操作类 |
| | | */ |
| | | public IPage<V> pageVo(IPage<T> page, Wrapper<T> queryWrapper) { |
| | | public <P extends IPage<V>> P pageVo(IPage<T> page, Wrapper<T> queryWrapper) { |
| | | return getBaseMapper().selectVoPage(page, queryWrapper, voClass); |
| | | } |
| | | |
| | |
| | | * @param <T> 数据库实体 |
| | | * @param <K> vo实体 |
| | | * @author Lion Li |
| | | * @deprecated 3.6.0 删除 请使用 {@link com.ruoyi.common.core.domain.PageQuery#build()} |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @Deprecated |
| | | public class PagePlus<T,K> implements IPage<T> { |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.common.core.page; |
| | | |
| | | import cn.hutool.http.HttpStatus; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | this.total = total; |
| | | } |
| | | |
| | | public static <T> TableDataInfo<T> build(IPage<T> page) { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(page.getRecords()); |
| | | rspData.setTotal(page.getTotal()); |
| | | return rspData; |
| | | } |
| | | |
| | | public static <T> TableDataInfo<T> build(List<T> list) { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(list); |
| | | rspData.setTotal(list.size()); |
| | | return rspData; |
| | | } |
| | | |
| | | public static <T> TableDataInfo<T> build() { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | | rspData.setMsg("查询成功"); |
| | | return rspData; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.http.HttpStatus; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | |
| | | * 分页工具 |
| | | * |
| | | * @author Lion Li |
| | | * @deprecated 3.6.0 删除 请使用 {@link PageQuery} 与 {@link TableDataInfo} |
| | | */ |
| | | @Deprecated |
| | | @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| | | public class PageUtils { |
| | | |
| | |
| | | /** |
| | | * 当前记录起始索引 默认值 |
| | | */ |
| | | @Deprecated |
| | | public static final int DEFAULT_PAGE_NUM = 1; |
| | | |
| | | /** |
| | | * 每页显示记录数 默认值 默认查全部 |
| | | */ |
| | | @Deprecated |
| | | public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE; |
| | | |
| | | /** |
| | |
| | | * @param <T> domain 实体 |
| | | * @param <K> vo 实体 |
| | | * @return 分页对象 |
| | | * @deprecated 3.6.0 删除 请使用 {@link PageUtils#buildPagePlus(PageQuery)} |
| | | * @deprecated 3.6.0 删除 请使用 {@link PageQuery#build()} |
| | | * 由于使用 Servlet 获取只能从 param 获取 灵活性降低 故将传参操作交给用户 |
| | | */ |
| | | @Deprecated |
| | |
| | | Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE); |
| | | String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN); |
| | | String isAsc = ServletUtils.getParameter(IS_ASC); |
| | | if (pageNum <= 0) { |
| | | pageNum = DEFAULT_PAGE_NUM; |
| | | } |
| | | PagePlus<T, K> page = new PagePlus<>(pageNum, pageSize); |
| | | OrderItem orderItem = buildOrderItem(orderByColumn, isAsc); |
| | | if (ObjectUtil.isNotNull(orderItem)) { |
| | | page.addOrder(orderItem); |
| | | } |
| | | return page; |
| | | } |
| | | |
| | | public static <T, K> PagePlus<T, K> buildPagePlus(PageQuery pageQuery) { |
| | | Integer pageNum = ObjectUtil.defaultIfNull(pageQuery.getPageNum(), DEFAULT_PAGE_NUM); |
| | | Integer pageSize = ObjectUtil.defaultIfNull(pageQuery.getPageSize(), DEFAULT_PAGE_SIZE); |
| | | String orderByColumn = pageQuery.getOrderByColumn(); |
| | | String isAsc = pageQuery.getIsAsc(); |
| | | if (pageNum <= 0) { |
| | | pageNum = DEFAULT_PAGE_NUM; |
| | | } |
| | |
| | | * |
| | | * @param <T> domain 实体 |
| | | * @return 分页对象 |
| | | * @deprecated 3.6.0 删除 请使用 {@link PageUtils#buildPage(PageQuery)} |
| | | * @deprecated 3.6.0 删除 请使用 {@link PageQuery#build()} |
| | | * 由于使用 Servlet 获取只能从 param 获取 灵活性降低 故将传参操作交给用户 |
| | | */ |
| | | @Deprecated |
| | |
| | | } |
| | | return page; |
| | | } |
| | | |
| | | public static <T> Page<T> buildPage(PageQuery pageQuery) { |
| | | Integer pageNum = ObjectUtil.defaultIfNull(pageQuery.getPageNum(), DEFAULT_PAGE_NUM); |
| | | Integer pageSize = ObjectUtil.defaultIfNull(pageQuery.getPageSize(), DEFAULT_PAGE_SIZE); |
| | | String orderByColumn = pageQuery.getOrderByColumn(); |
| | | String isAsc = pageQuery.getIsAsc(); |
| | | if (pageNum <= 0) { |
| | | pageNum = DEFAULT_PAGE_NUM; |
| | | } |
| | | Page<T> page = new Page<>(pageNum, pageSize); |
| | | OrderItem orderItem = buildOrderItem(orderByColumn, isAsc); |
| | | if (ObjectUtil.isNotNull(orderItem)) { |
| | | page.addOrder(orderItem); |
| | | } |
| | | return page; |
| | | } |
| | | |
| | | |
| | | private static OrderItem buildOrderItem(String orderByColumn, String isAsc) { |
| | | // 兼容前端排序类型 |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 构建 MP 普通分页对象 |
| | | * |
| | | * @param <T> domain 实体 |
| | | * @return 分页对象 |
| | | * @deprecated 3.6.0 删除 请使用 {@link PageQuery#build()} |
| | | * 由于使用 Servlet 获取只能从 param 获取 灵活性降低 故将传参操作交给用户 |
| | | */ |
| | | @Deprecated |
| | | public static <T, K> TableDataInfo<K> buildDataInfo(PagePlus<T, K> page) { |
| | | TableDataInfo<K> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * @deprecated 3.6.0 删除 请使用 {@link TableDataInfo#build(IPage)} |
| | | */ |
| | | @Deprecated |
| | | public static <T> TableDataInfo<T> buildDataInfo(Page<T> page) { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * @deprecated 3.6.0 删除 请使用 {@link TableDataInfo#build(List)} |
| | | */ |
| | | @Deprecated |
| | | public static <T> TableDataInfo<T> buildDataInfo(List<T> list) { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * @deprecated 3.6.0 删除 请使用 {@link TableDataInfo#build()} |
| | | */ |
| | | @Deprecated |
| | | public static <T> TableDataInfo<T> buildDataInfo() { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import com.ruoyi.demo.domain.bo.TestDemoBo; |
| | |
| | | @Override |
| | | public TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo); |
| | | PagePlus<TestDemo, TestDemoVo> result = pageVo(PageUtils.buildPagePlus(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(result); |
| | | Page<TestDemoVo> result = pageVo(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo); |
| | | Page<TestDemoVo> result = baseMapper.customPageList(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(result); |
| | | Page<TestDemoVo> result = baseMapper.customPageList(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | |
| | | |
| | | @Override |
| | | public TableDataInfo<GenTable> selectPageGenTableList(GenTable genTable, PageQuery pageQuery) { |
| | | Page<GenTable> page = baseMapper.selectPageGenTableList(PageUtils.buildPage(pageQuery), genTable); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<GenTable> page = baseMapper.selectPageGenTableList(pageQuery.build(), genTable); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<GenTable> selectPageDbTableList(GenTable genTable, PageQuery pageQuery) { |
| | | Page<GenTable> page = baseMapper.selectPageDbTableList(PageUtils.buildPage(pageQuery), genTable); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<GenTable> page = baseMapper.selectPageDbTableList(pageQuery.build(), genTable); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | #if($table.crud || $table.sub) |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | #end |
| | |
| | | @Override |
| | | public TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo); |
| | | PagePlus<${ClassName}, ${ClassName}Vo> result = pageVo(PageUtils.buildPagePlus(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(result); |
| | | Page<${ClassName}Vo> result = pageVo(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | #end |
| | | |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.service.ConfigService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.RedisUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | Page<SysConfig> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysConfig> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.RedisUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | |
| | | .like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel()) |
| | | .eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus()) |
| | | .orderByAsc(SysDictData::getDictSort); |
| | | Page<SysDictData> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysDictData> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.service.DictService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.RedisUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | Page<SysDictType> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysDictType> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.service.LogininforService; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.ip.AddressUtils; |
| | |
| | | if(StringUtils.isBlank(pageQuery.getOrderByColumn())) { |
| | | pageQuery.setOrderByColumn("info_id").setIsAsc("desc"); |
| | | } |
| | | Page<SysLogininfor> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysLogininfor> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.mapper.SysNoticeMapper; |
| | |
| | | .like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle()) |
| | | .eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType()) |
| | | .like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy()); |
| | | Page<SysNotice> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysNotice> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.service.OperLogService; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.ip.AddressUtils; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | |
| | | if(StringUtils.isBlank(pageQuery.getOrderByColumn())) { |
| | | pageQuery.setOrderByColumn("oper_id").setIsAsc("desc"); |
| | | } |
| | | Page<SysOperLog> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysOperLog> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.RedisUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.oss.constant.OssConstant; |
| | |
| | | @Override |
| | | public TableDataInfo<SysOssConfigVo> queryPageList(SysOssConfigBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysOssConfig> lqw = buildQueryWrapper(bo); |
| | | PagePlus<SysOssConfig, SysOssConfigVo> result = pageVo(PageUtils.buildPagePlus(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(result); |
| | | Page<SysOssConfigVo> result = pageVo(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.oss.entity.UploadResult; |
| | | import com.ruoyi.oss.factory.OssFactory; |
| | |
| | | @Override |
| | | public TableDataInfo<SysOssVo> queryPageList(SysOssBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysOss> lqw = buildQueryWrapper(bo); |
| | | PagePlus<SysOss, SysOssVo> result = pageVo(PageUtils.buildPagePlus(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(result); |
| | | Page<SysOssVo> result = pageVo(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysOss> buildQueryWrapper(SysOssBo bo) { |
| | |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | |
| | | .like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode()) |
| | | .eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus()) |
| | | .like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName()); |
| | | Page<SysPost> page = page(PageUtils.buildPage(pageQuery), lqw); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysPost> page = page(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | |
| | | |
| | | @Override |
| | | public TableDataInfo<SysRole> selectPageRoleList(SysRole role, PageQuery pageQuery) { |
| | | Page<SysRole> page = baseMapper.selectPageRoleList(PageUtils.buildPage(pageQuery), role); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysRole> page = baseMapper.selectPageRoleList(pageQuery.build(), role); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.service.UserService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | |
| | | |
| | | @Override |
| | | public TableDataInfo<SysUser> selectPageUserList(SysUser user, PageQuery pageQuery) { |
| | | Page<SysUser> page = baseMapper.selectPageUserList(PageUtils.buildPage(pageQuery), user); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysUser> page = baseMapper.selectPageUserList(pageQuery.build(), user); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<SysUser> selectAllocatedList(SysUser user, PageQuery pageQuery) { |
| | | Page<SysUser> page = baseMapper.selectAllocatedList(PageUtils.buildPage(pageQuery), user); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysUser> page = baseMapper.selectAllocatedList(pageQuery.build(), user); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<SysUser> selectUnallocatedList(SysUser user, PageQuery pageQuery) { |
| | | Page<SysUser> page = baseMapper.selectUnallocatedList(PageUtils.buildPage(pageQuery), user); |
| | | return PageUtils.buildDataInfo(page); |
| | | Page<SysUser> page = baseMapper.selectUnallocatedList(pageQuery.build(), user); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |