From 0c9dd349812b10090a965c00d4f2fe64466cdcbb Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 23 Mar 2025 09:00:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91IOT=EF=BC=9A=E5=A4=9A=E4=B8=AA=20ProductCategoryMapper?= =?UTF-8?q?=20=E7=9A=84=E5=90=8D=E5=AD=97=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IotProductCategoryServiceImpl.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductCategoryServiceImpl.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductCategoryServiceImpl.java index f03186866d..13a8d488e9 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductCategoryServiceImpl.java +++ b/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 public class IotProductCategoryServiceImpl implements IotProductCategoryService { @Resource - private IotProductCategoryMapper productCategoryMapper; + private IotProductCategoryMapper iotProductCategoryMapper; @Resource private IotProductService productService; @@ -40,7 +40,7 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService public Long createProductCategory(IotProductCategorySaveReqVO createReqVO) { // 插入 IotProductCategoryDO productCategory = BeanUtils.toBean(createReqVO, IotProductCategoryDO.class); - productCategoryMapper.insert(productCategory); + iotProductCategoryMapper.insert(productCategory); // 返回 return productCategory.getId(); } @@ -51,7 +51,7 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService validateProductCategoryExists(updateReqVO.getId()); // 更新 IotProductCategoryDO updateObj = BeanUtils.toBean(updateReqVO, IotProductCategoryDO.class); - productCategoryMapper.updateById(updateObj); + iotProductCategoryMapper.updateById(updateObj); } @Override @@ -59,18 +59,18 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService // 校验存在 validateProductCategoryExists(id); // 删除 - productCategoryMapper.deleteById(id); + iotProductCategoryMapper.deleteById(id); } private void validateProductCategoryExists(Long id) { - if (productCategoryMapper.selectById(id) == null) { + if (iotProductCategoryMapper.selectById(id) == null) { throw exception(PRODUCT_CATEGORY_NOT_EXISTS); } } @Override public IotProductCategoryDO getProductCategory(Long id) { - return productCategoryMapper.selectById(id); + return iotProductCategoryMapper.selectById(id); } @Override @@ -78,28 +78,28 @@ public class IotProductCategoryServiceImpl implements IotProductCategoryService if (CollUtil.isEmpty(ids)) { return CollUtil.newArrayList(); } - return productCategoryMapper.selectBatchIds(ids); + return iotProductCategoryMapper.selectBatchIds(ids); } @Override public PageResult getProductCategoryPage(IotProductCategoryPageReqVO pageReqVO) { - return productCategoryMapper.selectPage(pageReqVO); + return iotProductCategoryMapper.selectPage(pageReqVO); } @Override public List getProductCategoryListByStatus(Integer status) { - return productCategoryMapper.selectListByStatus(status); + return iotProductCategoryMapper.selectListByStatus(status); } @Override public Long getProductCategoryCount(LocalDateTime createTime) { - return productCategoryMapper.selectCountByCreateTime(createTime); + return iotProductCategoryMapper.selectCountByCreateTime(createTime); } @Override public Map getProductCategoryDeviceCountMap() { // 1. 获取所有数据 - List categoryList = productCategoryMapper.selectList(); + List categoryList = iotProductCategoryMapper.selectList(); List productList = productService.getProductList(); // TODO @super:不要 list 查询,返回内存,而是查询一个 Map Map deviceCountMapByProductId = deviceService.getDeviceCountMapByProductId();