From 7a22a1aa3377d1d63f197d8a7e030c6136263555 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 22 六月 2020 13:43:59 +0800 Subject: [PATCH] 全文搜索 --- src/main/java/com/zy/common/web/BaseController.java | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/common/web/BaseController.java b/src/main/java/com/zy/common/web/BaseController.java index af55b2b..a3f319e 100644 --- a/src/main/java/com/zy/common/web/BaseController.java +++ b/src/main/java/com/zy/common/web/BaseController.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.plugins.Page; import com.core.common.BaseRes; import com.core.common.Cools; import com.core.controller.AbstractBaseController; @@ -16,6 +17,7 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -48,6 +50,14 @@ } } return ""; + } + + protected <T> Page<T> toPage(Integer curr, Integer limit, Map<String, Object> param){ + Page<T> page = new Page<T>(curr, limit); + param.put("pageNumber", Integer.parseInt(String.valueOf(param.get("curr")))); + param.put("pageSize", Integer.parseInt(String.valueOf(param.get("limit")))); + page.setCondition(param); + return page; } /** @@ -83,7 +93,7 @@ } for (int i=0;i<columns.size();i++){ if (i==0){ - wrapper.and(); + wrapper.andNew(); } else { wrapper.or(); } -- Gitblit v1.9.1