From 65659a03fa8d3ff95c725ea81dcb8c11291c2773 Mon Sep 17 00:00:00 2001 From: lige <bestlige@outlook.com> Date: 星期六, 09 十二月 2023 10:48:12 +0800 Subject: [PATCH] 1 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjHarmTypeController.java | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjHarmTypeController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjHarmTypeController.java index 46060a9..724123d 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjHarmTypeController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjHarmTypeController.java @@ -4,16 +4,10 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; @@ -41,8 +35,17 @@ @GetMapping("/list") public TableDataInfo list(TjHarmType tjHarmType) { startPage(); -// List<TjHarmType> list = tjHarmTypeService.list(); - List<TjHarmType> list = tjHarmTypeService.selectTjHarmTypeList(tjHarmType); + LambdaQueryWrapper<TjHarmType> wq=new LambdaQueryWrapper<>(); + if (tjHarmType.getHarmCode()!=null){ + wq.like(TjHarmType::getHarmCode,tjHarmType.getHarmCode()); + } + if (tjHarmType.getHarmType()!=null){ + wq.like(TjHarmType::getHarmType,tjHarmType.getHarmType()); + } + if (tjHarmType.getHarmPinYin()!=null){ + wq.like(TjHarmType::getHarmPinYin,tjHarmType.getHarmPinYin()); + } + List<TjHarmType> list = tjHarmTypeService.list(wq); return getDataTable(list); } @@ -87,8 +90,8 @@ * 鍒犻櫎鑱屼笟鐥� */ @Log(title = "鑱屼笟鐥�", businessType = BusinessType.DELETE) - @DeleteMapping("/{aids}") - public AjaxResult remove(@PathVariable String[] aids) { + @DeleteMapping("/remove") + public AjaxResult remove(@RequestBody String[] aids) { return toAjax(tjHarmTypeService.removeByIds(Arrays.asList(aids))); } } -- Gitblit v1.8.0