From 901b2ab3e0e7c592602848cfa256f34c5b0c7bb8 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 11 一月 2024 09:57:01 +0800
Subject: [PATCH] #

---
 zy-asrs-framework/src/main/resources/templates/Controller.txt |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/zy-asrs-framework/src/main/resources/templates/Controller.txt b/zy-asrs-framework/src/main/resources/templates/Controller.txt
index 5b40eb5..47c5d5a 100644
--- a/zy-asrs-framework/src/main/resources/templates/Controller.txt
+++ b/zy-asrs-framework/src/main/resources/templates/Controller.txt
@@ -34,7 +34,8 @@
     public R page(@RequestParam(defaultValue = "1") Integer curr,
                   @RequestParam(defaultValue = "10") Integer limit,
                   @RequestParam(required = false) String condition,
-                  @RequestParam(required = false) String timeRange) {
+                  @RequestParam(required = false) String timeRange,
+                  @RequestParam Map<String, Object> param) {
         LambdaQueryWrapper<@{ENTITYNAME}> wrapper = new LambdaQueryWrapper<>();
         if (!Cools.isEmpty(condition)) {
             wrapper.like(@{ENTITYNAME}::get@{MAJORCOLUMN0}, condition);
@@ -95,7 +96,9 @@
     public R getDataKV(@RequestParam(required = false) String condition) {
         List<KeyValueVo> vos = new ArrayList<>();
         LambdaQueryWrapper<@{ENTITYNAME}> wrapper = new LambdaQueryWrapper<>();
-        wrapper.like(@{ENTITYNAME}::get@{MAJORCOLUMN0}, condition);
+        if (!Cools.isEmpty(condition)) {
+            wrapper.like(@{ENTITYNAME}::get@{MAJORCOLUMN0}, condition);
+        }
         @{SIMPLEENTITYNAME}Service.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.get@{MAJORCOLUMN0}()), item.get@{PRIMARYKEYCOLUMN}())));
         return R.ok().add(vos);
     }

--
Gitblit v1.9.1