refactor(material): 优化物料编码查询逻辑

- 移除 Mapper 层的 code 字段查询,统一在 Service 层处理
- 添加中铜编码和中铝编码的属性查询支持
- 实现物料编码查询的性能优化,减少数据库查询次数
- 添加分类筛选与编码查询的联合处理逻辑
- 实现属性ID的本地缓存机制,避免重复查询
- 优化查询结果为空时的提前返回逻辑
This commit is contained in:
wuzongyong
2026-01-07 11:14:46 +08:00
parent 9eb3198ce1
commit 426c410818
2 changed files with 89 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ public interface MaterialInfomationMapper extends BaseMapperX<MaterialInfomation
default PageResult<MaterialInfomationDO> selectPage(MaterialInfomationPageReqVO reqVO, Collection<Long> infomationIds) { default PageResult<MaterialInfomationDO> selectPage(MaterialInfomationPageReqVO reqVO, Collection<Long> infomationIds) {
return BaseMapperX.super.selectPage(reqVO, new LambdaQueryWrapperX<MaterialInfomationDO>() return BaseMapperX.super.selectPage(reqVO, new LambdaQueryWrapperX<MaterialInfomationDO>()
.likeIfPresent(MaterialInfomationDO::getCode, reqVO.getCode()) // code 字段的查询已在 Service 层处理(包含中铜编码、中铝编码),此处不再重复查询
.likeIfPresent(MaterialInfomationDO::getName, reqVO.getName()) .likeIfPresent(MaterialInfomationDO::getName, reqVO.getName())
.likeIfPresent(MaterialInfomationDO::getRemark, reqVO.getRemark()) .likeIfPresent(MaterialInfomationDO::getRemark, reqVO.getRemark())
.betweenIfPresent(MaterialInfomationDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(MaterialInfomationDO::getCreateTime, reqVO.getCreateTime())