zjh
2024-01-02 bd6c1c1c6642d57c85816a62d77c25c4e1a66a76
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,7 +35,17 @@
    @GetMapping("/list")
    public TableDataInfo list(TjHarmType tjHarmType) {
        startPage();
        List<TjHarmType> list = tjHarmTypeService.list();
        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);
    }
@@ -86,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)));
    }
}