From 6b5f7c66fc40d7f6099d561e31a34fbd50dd20d3 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 01 七月 2026 15:54:57 +0800
Subject: [PATCH] 初始化项目

---
 yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java |   68 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java
new file mode 100644
index 0000000..0ab2d68
--- /dev/null
+++ b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java
@@ -0,0 +1,68 @@
+package cn.iocoder.yudao.module.mdm.dal.mysql.item;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.mdm.controller.admin.item.vo.MdmItemPageReqVO;
+import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * MDM 鐗╂枡涓绘暟鎹� Mapper
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+@Mapper
+public interface MdmItemMapper extends BaseMapperX<MdmItemDO> {
+
+    default PageResult<MdmItemDO> selectPage(MdmItemPageReqVO reqVO, Collection<Long> categoryIds) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<MdmItemDO>()
+                .likeIfPresent(MdmItemDO::getCode, reqVO.getCode())
+                .likeIfPresent(MdmItemDO::getName, reqVO.getName())
+                .likeIfPresent(MdmItemDO::getBarCode, reqVO.getBarCode())
+                .inIfPresent(MdmItemDO::getCategoryId, categoryIds)
+                .eqIfPresent(MdmItemDO::getItemType, reqVO.getItemType())
+                .eqIfPresent(MdmItemDO::getBrandId, reqVO.getBrandId())
+                .eqIfPresent(MdmItemDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(MdmItemDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(MdmItemDO::getId));
+    }
+
+    default List<MdmItemDO> selectList(MdmItemPageReqVO reqVO, Collection<Long> categoryIds) {
+        return selectList(new LambdaQueryWrapperX<MdmItemDO>()
+                .likeIfPresent(MdmItemDO::getCode, reqVO.getCode())
+                .likeIfPresent(MdmItemDO::getName, reqVO.getName())
+                .inIfPresent(MdmItemDO::getCategoryId, categoryIds)
+                .eqIfPresent(MdmItemDO::getItemType, reqVO.getItemType())
+                .eqIfPresent(MdmItemDO::getStatus, reqVO.getStatus())
+                .orderByDesc(MdmItemDO::getId));
+    }
+
+    default MdmItemDO selectByCode(String code) {
+        return selectOne(MdmItemDO::getCode, code);
+    }
+
+    default MdmItemDO selectByBarCode(String barCode) {
+        return selectOne(MdmItemDO::getBarCode, barCode);
+    }
+
+    default Long selectCountByCategoryId(Long categoryId) {
+        return selectCount(MdmItemDO::getCategoryId, categoryId);
+    }
+
+    default Long selectCountByUnitMeasureId(Long unitMeasureId) {
+        return selectCount(MdmItemDO::getUnitMeasureId, unitMeasureId);
+    }
+
+    default Long selectCountByBrandId(Long brandId) {
+        return selectCount(MdmItemDO::getBrandId, brandId);
+    }
+
+    default List<MdmItemDO> selectListByIds(Collection<Long> ids) {
+        return selectList(MdmItemDO::getId, ids);
+    }
+
+}
\ No newline at end of file

--
Gitblit v1.9.3