开发OTA备案工具-车辆升级

This commit is contained in:
高嵩
2023-03-29 20:48:59 +08:00
parent 2bc71b83a7
commit 20042acca5
@@ -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<OtaBaSjList, IOtaBaSjL
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
LambdaQueryWrapper<OtaBaSjList> 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<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
return Result.OK(pageList);
}