From 19b596d3c05b1ca7ff80d8b802e7f6e03ad77dad Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 11 九月 2023 18:02:17 +0800
Subject: [PATCH] 修改   9.11

---
 standard-server/src/main/resources/mapper/TechniqueMapper.xml |  123 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 114 insertions(+), 9 deletions(-)

diff --git a/standard-server/src/main/resources/mapper/TechniqueMapper.xml b/standard-server/src/main/resources/mapper/TechniqueMapper.xml
index 0d8255b..2fc35c2 100644
--- a/standard-server/src/main/resources/mapper/TechniqueMapper.xml
+++ b/standard-server/src/main/resources/mapper/TechniqueMapper.xml
@@ -31,19 +31,124 @@
     </resultMap>
     <select id="selectAllTeq" resultMap="oneMap">
         select tq.id tqid,
-               device,
-               product_father,
-               product,
-               unit,
-               name,
-               father
+        device,
+        product_father,
+        product,
+        unit,
+        name,
+        father
         from mom_ocean.technique tq
-                 left join mom_ocean.technology tc on tq.technology_id = tc.id
+        left join mom_ocean.technology tc on tq.technology_id = tc.id
         where tq.state = 1
-          and specifications_id = #{specificationsId}
-          and tq.version = #{version}
+        and specifications_id = #{specificationsId}
+        and tq.version = #{version}
         <if test="message!=null and message!=''">
             and device like concat('%',#{message},'%')
         </if>
     </select>
+
+    <!--鍙充笂瑙掓柊澧�-鐢熶骇宸ヨ壓-閫夋嫨璁惧-->
+    <select id="chooseDev" resultType="java.util.Map">
+        select name device
+        from mom_ocean.device
+        where state = 1
+          and device_status in (1, 5)
+          and father = (select distinct device_group
+                        from mom_ocean.technology
+                        where technology.state = 1
+                          and technology.id = #{technologyId})
+    </select>
+
+    <!--鍙充笂瑙掓柊澧�-鐢熶骇宸ヨ壓-閫夋嫨椤圭洰(鐖跺瓙),鍗曚綅-->
+    <resultMap id="chooseProMap" type="map">
+        <id property="name" column="productFather"/>
+        <collection property="children" resultMap="chooseProMaps" javaType="List"/>
+    </resultMap>
+    <resultMap id="chooseProMaps" type="map">
+        <id property="name" column="product"/>
+        <result property="unit" column="unit"/>
+    </resultMap>
+    <select id="choosePro" resultMap="chooseProMap">
+        select name   product,
+               father productFather,
+               unit
+        from mom_ocean.product
+        where state = 1
+          and technology_id = #{technologyId}
+    </select>
+
+    <!--鏍规嵁鍨嬪彿id鏌ヨ璇ュ瀷鍙蜂笅鎵�鏈夊伐鑹虹殑鐢熶骇宸ヨ壓-->
+    <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Technique">
+        select *
+        from mom_ocean.technique
+        where state = 1
+          and version = #{version}
+          and technology_id in (select id
+                                from mom_ocean.technology
+                                where technology.state = 1
+                                  and specifications_id = #{specificationsId})
+    </select>
+    <!--鏍规嵁宸ヨ壓璺嚎id鏌ヨ鎵�鏈夌増鏈�-->
+    <select id="selectVerByTeId" resultType="java.lang.Integer">
+        select distinct version
+        from mom_ocean.technique
+        where state = 1
+          and technology_id = #{technologyId}
+    </select>
+
+    <!--鏌ヨ璇ュ伐鑹轰笅鏈�鏂扮増鏈湪涓�涓楠岄」鐩笅鍙互浣跨敤鍝簺璁惧-->
+    <select id="selDevByVerTecIdFaNam" resultType="java.util.Map">
+        select device.id, device
+        from mom_ocean.technique
+                 left join mom_ocean.device on name = device
+        where technique.state = 1
+          and technology_id = #{technologyId}
+          and product_father = #{father}
+          and product = #{name}
+          and version = #{ver}
+    </select>
+
+    <!--鏍规嵁id鏌ョ湅璇︽儏-->
+    <select id="selTeqById" resultType="java.util.Map">
+        select m.father,
+               type,
+               m.name,
+               st.name,
+               sp.name,
+               t.father,
+               t.name,
+               technology_id,
+               device,
+               product_father,
+               product,
+               unit
+        from mom_ocean.technique tq
+                 left join mom_ocean.technology t on tq.technology_id = t.id
+                 left join mom_ocean.specifications sp on t.specifications_id = sp.id
+                 left join mom_ocean.standard st on sp.standard_id = st.id
+                 left join mom_ocean.material m on st.material_id = m.id
+        where tq.state = 1
+          and tq.id = #{id}
+    </select>
+
+    <!--鏍规嵁宸ヨ壓璺嚎id鍒犻櫎鐢熶骇宸ヨ壓-->
+    <update id="delTeqByTecId">
+        update mom_ocean.technique
+        set state=0
+        where technology_id = #{id}
+    </update>
+
+    <!--鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎-->
+    <update id="delAllByTecId">
+        update mom_ocean.technique
+        set state=0
+        where technology_id in (${ids})
+    </update>
+
+    <!--鏍规嵁鐢熶骇宸ヨ壓id鎵归噺鍒犻櫎-->
+    <update id="delAllTeq">
+        update mom_ocean.technique
+        set state=0
+        where id in (${ids})
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3