From fa40e09b66af9d17b6d2dda1a3d4687ad72bf668 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 31 八月 2023 17:31:34 +0800
Subject: [PATCH] 标准BOM(展示+添加)
---
standard-server/src/main/resources/mapper/MaterialMapper.xml | 36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/standard-server/src/main/resources/mapper/MaterialMapper.xml b/standard-server/src/main/resources/mapper/MaterialMapper.xml
index 6c02f99..53e1662 100644
--- a/standard-server/src/main/resources/mapper/MaterialMapper.xml
+++ b/standard-server/src/main/resources/mapper/MaterialMapper.xml
@@ -26,17 +26,18 @@
<id property="id" column="spid"/>
<result property="name" column="spname"/>
</resultMap>
- <select id="selectTreeByMaterial" resultMap="selectTreeByMaterialMap" >
- select m.type, #涓�绾х被鍨�
- father, #浜岀骇浜у搧澶х被(4澶х被)
- m.id mid, #涓夌骇鐗╂枡id
+ <select id="selectTreeByMaterial" resultMap="selectTreeByMaterialMap">
+ select m.type, #涓�绾х被鍨�
+ father, #浜岀骇浜у搧澶х被(4澶х被)
+ m.id mid, #涓夌骇鐗╂枡id
m.name mname, #涓夌骇鏍峰搧鍚嶇О
- s.id sid, #鍥涚骇鏍囧噯id
+ s.id sid, #鍥涚骇鏍囧噯id
s.name sname, #鍥涚骇鏍囧噯鍚�
- sp.id spid, #浜旂骇鍨嬪彿id
+ sp.id spid, #浜旂骇鍨嬪彿id
sp.name spname #浜旂骇鍨嬪彿鍚�
- from (select type, id, name,father from mom_ocean.material where state = 1) m
- left join (select id, name, material_id from mom_ocean.standard where state = 1) s on m.id = s.material_id
+ from (select type, id, name, father from mom_ocean.material where state = 1) m
+ left join (select id, name, material_id from mom_ocean.standard where state = 1) s
+ on m.id = s.material_id
left join (select id, name, standard_id from mom_ocean.specifications where state = 1) sp
on sp.standard_id = s.id
</select>
@@ -48,10 +49,10 @@
</select>
<select id="selectIdByCoNa" resultType="java.util.Map">
- select m.id '鐗╂枡id',
- st.id '瑙勬牸id',
- st.name '瑙勬牸鍚嶇О',
- sp.name '鍨嬪彿鍚嶇О'
+ select m.id '鐗╂枡id',
+ st.id '瑙勬牸id',
+ st.name '瑙勬牸鍚嶇О',
+ sp.name '鍨嬪彿鍚嶇О'
from mom_ocean.material m,
mom_ocean.standard st,
mom_ocean.specifications sp
@@ -60,4 +61,15 @@
and m.name = #{name}
and code = #{code}
</select>
+
+ <!--鏍规嵁鏍囧噯id鏌ヨ鐗╂枡-->
+ <select id="selFath" resultType="com.yuanchu.mom.pojo.Material">
+ select *
+ from mom_ocean.material
+ where state = 1
+ and id = (select material_id
+ from mom_ocean.standard
+ where standard.state = 1
+ and standard.id = #{id})
+ </select>
</mapper>
--
Gitblit v1.9.3