From 9f9641ae7e6799afe55c37f983a213e386134aa9 Mon Sep 17 00:00:00 2001 From: mashuai Date: Fri, 25 Oct 2024 16:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/material/ma/controller/TypeController.java | 4 ++-- .../src/main/java/com/bonus/material/ma/domain/Type.java | 2 ++ .../java/com/bonus/material/ma/mapper/TypeMapper.java | 4 ++-- .../java/com/bonus/material/ma/service/ITypeService.java | 4 ++-- .../bonus/material/ma/service/impl/TypeServiceImpl.java | 8 ++++---- .../src/main/resources/mapper/material/ma/TypeMapper.xml | 8 ++++++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 8c5cfb0d..9e32a676 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -61,11 +61,11 @@ public class TypeController extends BaseController { */ @ApiOperation(value = "根据左列表类型id查询右表格") @GetMapping("/getListByMaType") - public AjaxResult getListByMaType(Type type) { + public AjaxResult getListByMaType(MaTypeListVo type) { List parentIds = typeService.selectParentId(type); List listByMaType = new ArrayList<>(); for (Integer parentId : parentIds) { - listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), type.getTypeName())); + listByMaType.addAll(typeService.getListByParentId(parentId.longValue(), type)); } Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java index 97279c9f..7f295c31 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java @@ -160,6 +160,8 @@ public class Type extends BaseEntity { @ApiModelProperty(value = "推送智慧工程定义的门类分类机具编码") private String intelligentCode; + private String keyword; + /** 子节点 */ @JsonInclude(JsonInclude.Include.NON_EMPTY) private List children = new ArrayList<>(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index 887b8788..4bcb2401 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -29,7 +29,7 @@ public interface TypeMapper { * 根据level层级和typeID 查询父级ID * @param type */ - List selectParentId(Type type); + List selectParentId(MaTypeListVo type); /** * 根据物资仓库的ID查询物资类型列表 @@ -37,7 +37,7 @@ public interface TypeMapper { */ List selectMaTypeListByHouseId(Long houseId); - List getListByTypeName(@Param("typeId") Long typeId, @Param("typeName") String typeName); + List getListByTypeName(@Param("typeId") Long typeId, @Param("type") MaTypeListVo type); /** * 查询物资类型下拉树结构--根据上级ID diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java index 6cf24707..b6893b75 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -23,13 +23,13 @@ public interface ITypeService { */ Type selectTypeByTypeId(Long typeId); - List selectParentId(Type type); + List selectParentId(MaTypeListVo type); List getEquipmentType(Long typeId, String typeName); List selectMaTypeListByHouseId(Long houseId); - List getListByParentId(Long typeId, String typeName); + List getListByParentId(Long typeId, MaTypeListVo type); /** * 查询物资类型下拉树结构--根据上级ID diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 0c613ac0..a0164353 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -64,7 +64,7 @@ public class TypeServiceImpl implements ITypeService { } @Override - public List selectParentId(Type type) { + public List selectParentId(MaTypeListVo type) { return typeMapper.selectParentId(type); } @@ -100,11 +100,11 @@ public class TypeServiceImpl implements ITypeService { * 根据组织树parent_id查询结果 * * @param typeId 父级id - * @param typeName 名称筛选 + * @param type 名称筛选 */ @Override - public List getListByParentId(Long typeId, String typeName) { - return typeMapper.getListByTypeName(typeId, typeName); + public List getListByParentId(Long typeId, MaTypeListVo type) { + return typeMapper.getListByTypeName(typeId, type); } @Override diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index f1bc260e..a7dfa44c 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -436,8 +436,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id and m3.del_flag = '0' WHERE m.parent_id = #{typeId} and m.del_flag = '0' - - AND m.type_name like concat('%',#{typeName},'%') + + AND (m.type_name like concat('%',#{keyword},'%') + or m1.type_name like concat('%',#{keyword},'%') + or m2.type_name like concat('%',#{keyword},'%') + or m3.type_name like concat('%',#{keyword},'%') + )