| | |
| | | return eamEquipmentMapper.selectOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<EamEquipment> queryByProductionId(String productionId) { |
| | | QueryWrapper<EamEquipment> queryWrapper = new QueryWrapper<>(); |
| | | //车间为空 则查询所有设备 |
| | | if (StringUtils.isNotBlank(productionId)) { |
| | | //车间编码不为空 |
| | | List<String> productIds = mdcProductionService.recursionChildren(productionId); |
| | | if (CollectionUtil.isEmpty(productIds)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | if(productIds.size() == 1) { |
| | | queryWrapper.eq("e.org_id", productIds.get(0)); |
| | | }else { |
| | | queryWrapper.in("e.org_id", productIds); |
| | | } |
| | | } |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | List<EamEquipment> list = eamEquipmentMapper.queryByProductionIds(queryWrapper); |
| | | if(CollectionUtil.isNotEmpty(list)) { |
| | | return list; |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有的产线id(包含所有上级) |
| | | */ |