From 3b7f72ee9c450955ecef1897d10d27e547f20476 Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期五, 01 九月 2023 17:07:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 standard-server/src/main/resources/mapper/ProductMapper.xml |   63 ++++++++++++++++++++++++++-----
 1 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/standard-server/src/main/resources/mapper/ProductMapper.xml b/standard-server/src/main/resources/mapper/ProductMapper.xml
index 4fcd5c3..4a3bf35 100644
--- a/standard-server/src/main/resources/mapper/ProductMapper.xml
+++ b/standard-server/src/main/resources/mapper/ProductMapper.xml
@@ -51,21 +51,62 @@
         <result property="internal" column="internal"/>
     </resultMap>
     <select id="selectAllPro" resultMap="oneMap">
-        select p.id     pid,
-               p.name   pname,
-               p.father pfather,
-               unit,
-               required,
-               internal,
-               t.father tfather,
-               t.name   tname
+        select p.id pid,
+        p.name pname,
+        p.father pfather,
+        unit,
+        required,
+        internal,
+        t.father tfather,
+        t.name tname
         from mom_ocean.product p
-                 left join mom_ocean.technology t on p.technology_id = t.id
+        left join mom_ocean.technology t on p.technology_id = t.id
         where p.state = 1
-          and p.version = #{version}
-          and specifications_id = #{specificationsId}
+        and p.version = #{version}
+        and specifications_id = #{specificationsId}
         <if test="message!=null and message!=''">
             and p.name like concat('%',#{message},'%')
         </if>
     </select>
+
+    <!--鍙充笂瑙掓柊澧�-鎶�鏈寚鏍�-閫夋嫨椤圭洰鐖剁被-->
+    <select id="chooseFather" resultType="java.util.Map">
+        select distinct father
+        from mom_ocean.product
+        where state = 1
+          and technology_id = #{technologyId}
+    </select>
+
+    <!--鏍规嵁鍨嬪彿id鏌ヨ璇ュ瀷鍙蜂笅鐨勬墍鏈夊伐鑹虹殑鎶�鏈寚鏍�-->
+    <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Product">
+        select *
+        from mom_ocean.product
+        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鍒犻櫎-->
+    <update id="delProByTecId">
+        update mom_ocean.product
+        set state=0
+        where technology_id = #{id}
+    </update>
+
+    <!--鏍规嵁宸ヨ壓璺嚎id鎵归噺鍒犻櫎-->
+    <update id="delAllByTechId">
+        update mom_ocean.product
+        set state=0
+        where technology_id in (${ids})
+    </update>
+
+    <!--鏍规嵁鎶�鏈寚鏍噄d鎵归噺鍒犻櫎-->
+    <update id="delAllPro">
+        update mom_ocean.product
+        set state=0
+        where id in (${ids})
+    </update>
 </mapper>

--
Gitblit v1.9.3