From 20042acca5b8abe2eb3c2b5ae1696c185f84e882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Wed, 29 Mar 2023 20:48:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91OTA=E5=A4=87=E6=A1=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7-=E8=BD=A6=E8=BE=86=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ota/controller/OtaBaSjListController.java | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java index 344eafb8c..a7ebadbc4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java @@ -1,6 +1,7 @@ package com.jero.modules.ota.controller; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -8,11 +9,13 @@ import com.jero.common.api.vo.Result; import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.ota.entity.OtaBaCxList; import com.jero.modules.ota.entity.OtaBaSjList; import com.jero.modules.ota.service.IOtaBaSjListService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -55,9 +58,37 @@ public class OtaBaSjListController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap()); - queryWrapper.orderByDesc("create_time"); Page page = new Page(pageNo, pageSize); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + String cpdjbh = req.getParameter("cpdjbh"); + if (StringUtils.isNotBlank(cpdjbh)) { + cpdjbh = cpdjbh.replace("%", "\\%"); + queryWrapper.like(OtaBaSjList::getCpdjbh, cpdjbh); + } + String ggpc = req.getParameter("ggpc"); + if (StringUtils.isNotBlank(ggpc)) { + ggpc = ggpc.replace("%", "\\%"); + queryWrapper.like(OtaBaSjList::getGgpc, ggpc); + } + + String cpsb = req.getParameter("cpsb"); + if (StringUtils.isNotBlank(cpsb)) { + cpsb = cpsb.replace("%", "\\%"); + queryWrapper.like(OtaBaSjList::getCpsb, cpsb); + } + + String cpmc = req.getParameter("cpmc"); + if (StringUtils.isNotBlank(cpmc)) { + cpmc = cpmc.replace("%", "\\%"); + queryWrapper.like(OtaBaSjList::getCpmc, cpmc); + } + + String cpxh = req.getParameter("cpmc"); + if (StringUtils.isNotBlank(cpxh)) { + cpxh = cpxh.replace("%", "\\%"); + queryWrapper.like(OtaBaSjList::getCpxh, cpxh); + } + IPage pageList = otaBaSjListService.page(page, queryWrapper); return Result.OK(pageList); }