Browse Source

:zap: 优化查询方式

Twelve615 1 year ago
parent
commit
8967fd6cca

+ 4 - 0
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admin_file_export/controller/AdminFileExportController.java

@@ -10,6 +10,7 @@ import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.google.common.base.Strings;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -70,6 +71,9 @@ public class AdminFileExportController extends JeecgController<AdminFileExport,
                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                    HttpServletRequest req) {
+        if (adminFileExport !=null && !Strings.isNullOrEmpty(adminFileExport.getName())) {
+            adminFileExport.setName("*" + adminFileExport.getName() + "*");
+        }
         QueryWrapper<AdminFileExport> queryWrapper = QueryGenerator.initQueryWrapper(adminFileExport, req.getParameterMap());
         Page<AdminFileExport> page = new Page<AdminFileExport>(pageNo, pageSize);
         IPage<AdminFileExport> pageList = adminFileExportService.page(page, queryWrapper);