Commit bbcea0c3 authored by tianbo's avatar tianbo

refactor(设备分类查询):优化设备分类筛选逻辑

- 修改了设备分类筛选方式,从根据编码规则筛选改为根据描述字段筛选 - 更新了 EquipmentCategoryMapper.xml 中的查询条件,使用 is_delete 字段进行筛选
parent cbce352f
......@@ -2368,13 +2368,13 @@ public class CommonServiceImpl implements ICommonService {
List<EquipmentCategoryDto> result = Collections.emptyList();
switch (type) {
case "1":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0]*000$").matcher(category.getCode()).matches()).collect(Collectors.toList());
result = categoryList.stream().filter(category -> category.getDescription().equals("EQU_LIST")).collect(Collectors.toList());
break;
case "2":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\0]*00$").matcher(category.getCode()).matches()).collect(Collectors.toList());
result = categoryList.stream().filter(category -> category.getDescription().equals("EQU_CATEGORY")).collect(Collectors.toList());
break;
case "3":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0A-Za-z]*[A-Za-z0-9]*[^0]0$").matcher(category.getCode()).matches()).collect(Collectors.toList());
result = categoryList.stream().filter(category -> category.getDescription().equals("EQU_DEFINE")).collect(Collectors.toList());
break;
}
return result;
......
......@@ -710,7 +710,7 @@
<select id="selectClassifyNoStart7ByParentCode" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto">
select * from tz_equipment_category
<where>
code NOT LIKE '7%'
is_delete = 0
<if test="parentCode != null and parentCode != ''">
and parent_id = (SELECT id FROM tz_equipment_category WHERE code = #{parentCode} )
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment