From d4f49b10d756460ef2884931c1ddc381ec2f3a6f Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 03 十二月 2021 15:58:16 +0800
Subject: [PATCH] update 重构代码生成分页相关 基于新分页方法

---
 ruoyi-generator/src/main/resources/vm/java/bo.java.vm          |   24 ------------------------
 ruoyi-generator/src/main/resources/vm/java/controller.java.vm  |    5 +++--
 ruoyi-generator/src/main/resources/vm/java/service.java.vm     |    3 ++-
 ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm |    9 ++++++---
 4 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/ruoyi-generator/src/main/resources/vm/java/bo.java.vm b/ruoyi-generator/src/main/resources/vm/java/bo.java.vm
index 8831d0c..94d6050 100644
--- a/ruoyi-generator/src/main/resources/vm/java/bo.java.vm
+++ b/ruoyi-generator/src/main/resources/vm/java/bo.java.vm
@@ -63,28 +63,4 @@
 #end
 #end
 
-    /**
-     * 鍒嗛〉澶у皬
-     */
-    @ApiModelProperty("鍒嗛〉澶у皬")
-    private Integer pageSize;
-
-    /**
-     * 褰撳墠椤垫暟
-     */
-    @ApiModelProperty("褰撳墠椤垫暟")
-    private Integer pageNum;
-
-    /**
-     * 鎺掑簭鍒�
-     */
-    @ApiModelProperty("鎺掑簭鍒�")
-    private String orderByColumn;
-
-    /**
-     * 鎺掑簭鐨勬柟鍚慸esc鎴栬�卆sc
-     */
-    @ApiModelProperty(value = "鎺掑簭鐨勬柟鍚�", example = "asc,desc")
-    private String isAsc;
-
 }
diff --git a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm
index ae6f818..1f94b69 100644
--- a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm
+++ b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm
@@ -14,6 +14,7 @@
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.PageQuery;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
@@ -53,8 +54,8 @@
     @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
     @GetMapping("/list")
 #if($table.crud || $table.sub)
-    public TableDataInfo<${ClassName}Vo> list(@Validated(QueryGroup.class) ${ClassName}Bo bo) {
-        return i${ClassName}Service.queryPageList(bo);
+    public TableDataInfo<${ClassName}Vo> list(@Validated(QueryGroup.class) ${ClassName}Bo bo, PageQuery pageQuery) {
+        return i${ClassName}Service.queryPageList(bo, pageQuery);
     }
 #elseif($table.tree)
     public AjaxResult<List<${ClassName}Vo>> list(@Validated(QueryGroup.class) ${ClassName}Bo bo) {
diff --git a/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/ruoyi-generator/src/main/resources/vm/java/service.java.vm
index 0041c39..f93053c 100644
--- a/ruoyi-generator/src/main/resources/vm/java/service.java.vm
+++ b/ruoyi-generator/src/main/resources/vm/java/service.java.vm
@@ -6,6 +6,7 @@
 import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 #if($table.crud || $table.sub)
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.domain.PageQuery;
 #end
 
 import java.util.Collection;
@@ -28,7 +29,7 @@
 	/**
 	 * 鏌ヨ鍒楄〃
 	 */
-    TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo);
+    TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery);
 #end
 
 	/**
diff --git a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm
index b9a45c6..15059c0 100644
--- a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm
+++ b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm
@@ -6,6 +6,7 @@
 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
 import org.springframework.stereotype.Service;
 import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
@@ -37,15 +38,17 @@
 
 #if($table.crud || $table.sub)
     @Override
-    public TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo) {
-        PagePlus<${ClassName}, ${ClassName}Vo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
+    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);
     }
 #end
 
     @Override
     public List<${ClassName}Vo> queryList(${ClassName}Bo bo) {
-        return listVo(buildQueryWrapper(bo));
+        LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo);
+        return listVo(lqw);
     }
 
     private LambdaQueryWrapper<${ClassName}> buildQueryWrapper(${ClassName}Bo bo) {

--
Gitblit v1.9.3