From d06b9e4f34481b3336599a232c8b52bd04955297 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期五, 14 八月 2026 15:55:20 +0800
Subject: [PATCH] 解决修改商机时,商机产品的辅单位没有回显问题
---
yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 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
index 0ab2d68..1309623 100644
--- 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
@@ -6,14 +6,16 @@
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 org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
/**
* MDM 鐗╂枡涓绘暟鎹� Mapper
*
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
*/
@Mapper
public interface MdmItemMapper extends BaseMapperX<MdmItemDO> {
@@ -45,6 +47,22 @@
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);
}
@@ -65,4 +83,12 @@
return selectList(MdmItemDO::getId, ids);
}
+ /**
+ * 鏌ヨ鐗╂枡琚摢浜涗笟鍔¤〃寮曠敤锛堟湭鍒犻櫎鐨勮褰曪級
+ *
+ * @param itemId 鐗╂枡缂栧彿
+ * @return 寮曠敤鏉ユ簮鍒楄〃锛屾瘡椤瑰寘鍚� source(鏉ユ簮鍚�) 鍜� cnt(寮曠敤鏁伴噺)锛屼粎杩斿洖 cnt > 0 鐨�
+ */
+ List<Map<String, Object>> selectItemReferenceCount(@Param("itemId") Long itemId);
+
}
\ No newline at end of file
--
Gitblit v1.9.3