From fdba1595d89d44ced189890c7bc7c918209d4c6d Mon Sep 17 00:00:00 2001
From: lixiangyu <lixiangyu@xalxzn.com>
Date: 星期四, 21 八月 2025 18:00:32 +0800
Subject: [PATCH] feat(cms): 实现刀具入库单提交功能并优化 Excel导入逻辑
---
src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml | 51 ++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
index 4e876b7..f4dcaf8 100644
--- a/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
+++ b/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -12,7 +12,7 @@
<!--鏌ヨ璁惧鐨勬墍灞炰骇绾垮悕绉颁俊鎭�-->
<select id="getProNamesByEquipmentIds" resultType="org.jeecg.modules.mdc.vo.MdcEquipmentProVo">
- SELECT p.production_name, pe.equipment_id FROM mdc_production_equipment pe, mdc_production p WHERE p.id = pe.production_id AND pe.equipment_id IN
+ SELECT f.factory_name, bef.equipment_id FROM base_equipment_factory bef, base_factory f WHERE f.id = bef.factory_id AND bef.equipment_id IN
<foreach collection="equipmentIds" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
@@ -95,10 +95,10 @@
me.*
FROM
mdc_equipment me
- LEFT JOIN mdc_production_equipment mpe ON me.id = mpe.equipment_id
+ LEFT JOIN base_equipment_factory mpe ON me.id = mpe.equipment_id
WHERE
- mpe.production_id IN
- <foreach collection="allProductionIds" index="index" item="id" open="(" separator="," close=")">
+ mpe.factory_id IN
+ <foreach collection="allFactoryIds" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
@@ -181,14 +181,14 @@
SELECT
mp.id,
mp.parent_id,
- mp.production_name,
- mp.org_type,
+ mp.factory_name AS productionName,
+ mp.factory_category AS orgtype,
me.equipment_id,
me.equipment_name,
me.equipment_type
FROM
- mdc_production_equipment mpe
- LEFT JOIN mdc_production mp ON mpe.production_id = mp.id
+ base_equipment_factory mpe
+ LEFT JOIN base_factory mp ON mpe.factory_id = mp.id
LEFT JOIN mdc_equipment me ON me.id = mpe.equipment_id
<where>
me.equipment_id IN
@@ -196,7 +196,7 @@
#{id}
</foreach>
</where>
- ORDER BY mp.production_order
+ ORDER BY mp.sorter
</select>
<!--鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃-->
@@ -221,8 +221,8 @@
t1.*
FROM
mdc_equipment t1
- LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id
- LEFT JOIN mdc_production t3 ON t2.production_id = t3.id
+ LEFT JOIN base_equipment_factory t2 ON t1.id = t2.equipment_id
+ LEFT JOIN base_factory t3 ON t2.factory_id = t3.id
<where>
<if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' ">
AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%')
@@ -260,8 +260,8 @@
t1.*
FROM
mdc_equipment t1
- LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id
- LEFT JOIN mdc_production t3 ON t2.production_id = t3.id
+ LEFT JOIN base_equipment_factory t2 ON t1.id = t2.equipment_id
+ LEFT JOIN base_factory t3 ON t2.production_id = t3.id
<where>
<if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' ">
AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%')
@@ -402,4 +402,29 @@
</where>
</select>
+ <select id="queryByFactoryId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
+ SELECT
+ me.*
+ FROM
+ base_equipment_factory bef,
+ mdc_equipment me
+ WHERE
+ bef.equipment_id = me.id
+ AND bef.factory_id = #{ factoryId }
+ ORDER BY me.equipment_id
+ </select>
+
+ <select id="queryIdsByFactorys" resultType="java.lang.String">
+ SELECT
+ me.equipment_id
+ FROM
+ mdc_equipment me
+ LEFT JOIN base_equipment_factory bef ON me.id = bef.equipment_id
+ WHERE
+ bef.factory_id IN
+ <foreach collection="allFactoryIds" index="index" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </select>
+
</mapper>
--
Gitblit v1.9.3