From 3aa3f9e730127147236c9e7627920dd8aacf3a36 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 15 七月 2026 15:49:59 +0800
Subject: [PATCH] 1.仓储物流-批次号优化覆盖数据 2.仓储物流-新增自定义出入库流水查询 3.采购管理-清理无用代码和表 4.销售管理-清理无用代码和表 5.销售流程状态字段数据回游

---
 yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java |   84 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 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..04edd6b
--- /dev/null
+++ b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java
@@ -0,0 +1,84 @@
+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);
+    }
+
+    /**
+     * 鏍规嵁缂栫爜鍜屽垹闄ょ姸鎬佹煡璇㈢墿鏂欙紙鐢ㄤ簬瑙e喅杞垹闄ゅ敮涓�閿啿绐侊級
+     */
+    default MdmItemDO selectByCodeAndDeleted(String code, Boolean deleted) {
+        return selectOne(new LambdaQueryWrapperX<MdmItemDO>()
+                .eq(MdmItemDO::getCode, code)
+                .eq(MdmItemDO::getDeleted, deleted));
+    }
+
+    /**
+     * 鐗╃悊鍒犻櫎锛堢敤浜庢竻鐞嗗凡杞垹闄ょ殑閲嶅璁板綍锛�
+     * 娉ㄦ剰锛氱敱浜� BaseDO 鏈� @TableLogic锛宒eleteById 鏄蒋鍒犻櫎锛岄渶瑕佷娇鐢ㄥ師鐢� SQL
+     */
+    @org.apache.ibatis.annotations.Delete("DELETE FROM mdm_item WHERE id = #{id}")
+    void physicalDeleteById(Long id);
+
+    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