| | |
| | | package com.iailab.framework.mybatis.core.mapper; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.iailab.framework.common.constant.Constant; |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.pojo.SortablePageParam; |
| | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface BaseMapperX<T> extends MPJBaseMapper<T> { |
| | | |
| | | /** |
| | | * 获取分页对象 |
| | | * @param params 分页查询参数 |
| | | */ |
| | | default IPage<T> getPage(PageParam params) { |
| | | //分页参数 |
| | | long curPage = 1; |
| | | long limit = 10; |
| | | |
| | | if(params.getPageNo() != null){ |
| | | curPage = params.getPageNo(); |
| | | } |
| | | if(params.getPageSize() != null){ |
| | | limit = params.getPageSize(); |
| | | } |
| | | |
| | | //分页对象 |
| | | return new Page<>(curPage, limit); |
| | | } |
| | | |
| | | default PageResult<T> selectPage(SortablePageParam pageParam, @Param("ew") Wrapper<T> queryWrapper) { |
| | | return selectPage(pageParam, pageParam.getSortingFields(), queryWrapper); |
| | | } |