Commit 0c9dd349812b10090a965c00d4f2fe64466cdcbb
1 parent
9b111996
【功能修复】IOT:多个 ProductCategoryMapper 的名字冲突
Showing
1 changed file
with
11 additions
and
11 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductCategoryServiceImpl.java
| ... | ... | @@ -29,7 +29,7 @@ import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.PRODUCT_CATEG |
| 29 | 29 | public class IotProductCategoryServiceImpl implements IotProductCategoryService { |
| 30 | 30 | |
| 31 | 31 | @Resource |
| 32 | - private IotProductCategoryMapper productCategoryMapper; | |
| 32 | + private IotProductCategoryMapper iotProductCategoryMapper; | |
| 33 | 33 | |
| 34 | 34 | @Resource |
| 35 | 35 | private IotProductService productService; |
| ... | ... | @@ -40,7 +40,7 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService |
| 40 | 40 | public Long createProductCategory(IotProductCategorySaveReqVO createReqVO) { |
| 41 | 41 | // 插入 |
| 42 | 42 | IotProductCategoryDO productCategory = BeanUtils.toBean(createReqVO, IotProductCategoryDO.class); |
| 43 | - productCategoryMapper.insert(productCategory); | |
| 43 | + iotProductCategoryMapper.insert(productCategory); | |
| 44 | 44 | // 返回 |
| 45 | 45 | return productCategory.getId(); |
| 46 | 46 | } |
| ... | ... | @@ -51,7 +51,7 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService |
| 51 | 51 | validateProductCategoryExists(updateReqVO.getId()); |
| 52 | 52 | // 更新 |
| 53 | 53 | IotProductCategoryDO updateObj = BeanUtils.toBean(updateReqVO, IotProductCategoryDO.class); |
| 54 | - productCategoryMapper.updateById(updateObj); | |
| 54 | + iotProductCategoryMapper.updateById(updateObj); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | @Override |
| ... | ... | @@ -59,18 +59,18 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService |
| 59 | 59 | // 校验存在 |
| 60 | 60 | validateProductCategoryExists(id); |
| 61 | 61 | // 删除 |
| 62 | - productCategoryMapper.deleteById(id); | |
| 62 | + iotProductCategoryMapper.deleteById(id); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | private void validateProductCategoryExists(Long id) { |
| 66 | - if (productCategoryMapper.selectById(id) == null) { | |
| 66 | + if (iotProductCategoryMapper.selectById(id) == null) { | |
| 67 | 67 | throw exception(PRODUCT_CATEGORY_NOT_EXISTS); |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | @Override |
| 72 | 72 | public IotProductCategoryDO getProductCategory(Long id) { |
| 73 | - return productCategoryMapper.selectById(id); | |
| 73 | + return iotProductCategoryMapper.selectById(id); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | @Override |
| ... | ... | @@ -78,28 +78,28 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService |
| 78 | 78 | if (CollUtil.isEmpty(ids)) { |
| 79 | 79 | return CollUtil.newArrayList(); |
| 80 | 80 | } |
| 81 | - return productCategoryMapper.selectBatchIds(ids); | |
| 81 | + return iotProductCategoryMapper.selectBatchIds(ids); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | @Override |
| 85 | 85 | public PageResult<IotProductCategoryDO> getProductCategoryPage(IotProductCategoryPageReqVO pageReqVO) { |
| 86 | - return productCategoryMapper.selectPage(pageReqVO); | |
| 86 | + return iotProductCategoryMapper.selectPage(pageReqVO); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | @Override |
| 90 | 90 | public List<IotProductCategoryDO> getProductCategoryListByStatus(Integer status) { |
| 91 | - return productCategoryMapper.selectListByStatus(status); | |
| 91 | + return iotProductCategoryMapper.selectListByStatus(status); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | @Override |
| 95 | 95 | public Long getProductCategoryCount(LocalDateTime createTime) { |
| 96 | - return productCategoryMapper.selectCountByCreateTime(createTime); | |
| 96 | + return iotProductCategoryMapper.selectCountByCreateTime(createTime); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | @Override |
| 100 | 100 | public Map<String, Integer> getProductCategoryDeviceCountMap() { |
| 101 | 101 | // 1. 获取所有数据 |
| 102 | - List<IotProductCategoryDO> categoryList = productCategoryMapper.selectList(); | |
| 102 | + List<IotProductCategoryDO> categoryList = iotProductCategoryMapper.selectList(); | |
| 103 | 103 | List<IotProductDO> productList = productService.getProductList(); |
| 104 | 104 | // TODO @super:不要 list 查询,返回内存,而是查询一个 Map<productId, count> |
| 105 | 105 | Map<Long, Integer> deviceCountMapByProductId = deviceService.getDeviceCountMapByProductId(); | ... | ... |