4 changed files with 62 additions and 6 deletions
@ -1 +1 @@ |
|||||
Subproject commit 60b469fb3d9fccb7220f65c3ddbaa412033ecc01 |
Subproject commit 6f363d0fee687011f3fd37341fd7afbbdd2805c4 |
@ -0,0 +1,53 @@ |
|||||
|
package com.elink.esua.epdc.vaccine.common.base; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.CrudServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.Constant; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 重写一些方法 |
||||
|
* |
||||
|
* @author work@yujt.net.cn |
||||
|
*/ |
||||
|
public abstract class BaseVimCurdServiceImpl<M extends BaseMapper<T>, T, D> extends CrudServiceImpl<M, T, D> { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public <T1> IPage<T1> getPage(Map<String, Object> params) { |
||||
|
//分页参数
|
||||
|
long curPage = 1; |
||||
|
long limit = 10; |
||||
|
|
||||
|
if (params.get(Constant.PAGE) != null) { |
||||
|
curPage = Long.parseLong((String) params.get(Constant.PAGE)); |
||||
|
} |
||||
|
if (params.get(Constant.LIMIT) != null) { |
||||
|
limit = Long.parseLong((String) params.get(Constant.LIMIT)); |
||||
|
} |
||||
|
|
||||
|
//分页对象
|
||||
|
Page<T1> page = new Page<>(curPage, limit); |
||||
|
|
||||
|
//分页参数
|
||||
|
params.put(Constant.PAGE, page); |
||||
|
|
||||
|
return page; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageData<D> page(Map<String, Object> params) { |
||||
|
IPage<T> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, currentDtoClass()); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
Loading…
Reference in new issue