From 3ea77d7604b206373317f0c3927d03181f3f10ac Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 11 Jul 2022 15:08:24 +0800
Subject: [PATCH] noz管理

---
 src/main/java/org/springblade/modules/stock/mapper/StockMapper.xml |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/stock/mapper/StockMapper.xml b/src/main/java/org/springblade/modules/stock/mapper/StockMapper.xml
index 9ce33e7..a74508d 100644
--- a/src/main/java/org/springblade/modules/stock/mapper/StockMapper.xml
+++ b/src/main/java/org/springblade/modules/stock/mapper/StockMapper.xml
@@ -76,6 +76,52 @@
             and stf.agricultural_name like concat('%', #{stock.agrname},'%')
         </if>
     </select>
+
+    <select id="selectListss" resultType="org.springblade.modules.stock.vo.StockVO">
+        SELECT st.*,
+        stf.factory_name AS factoryName,
+        a.dict_value AS stype,
+        d.dict_value AS dic1,
+        c.dict_value AS dic2,
+        stf.agricultural_name as agrname
+        FROM sys_stock st
+        LEFT JOIN sys_stockfactory stf ON stf.id = st.stock_id
+        LEFT JOIN (SELECT dict_key, dict_value
+        FROM blade_dict_biz
+        WHERE CODE = 'stockSpecs1' AND is_deleted = 0
+        <if test="stock.codes!=null and stock.codes != ''">
+            AND blade_dict_biz.tenant_id = #{stock.codes}
+        </if>) d ON d.dict_key = st.specs_value1
+        LEFT JOIN (SELECT dict_key, dict_value
+        FROM blade_dict_biz
+        WHERE CODE = 'stockSpecs2' AND is_deleted = 0  <if test="stock.codes!=null and stock.codes != ''">
+        AND blade_dict_biz.tenant_id = #{stock.codes}
+    </if>) c ON c.dict_key = st.specs_value2
+        LEFT JOIN ( SELECT dict_key, dict_value FROM blade_dict_biz WHERE CODE = 'stockType' AND is_deleted = 0
+        <if test="stock.codes!=null and stock.codes != ''">
+            AND blade_dict_biz.tenant_id = #{stock.codes}
+        </if>) a ON
+        a.dict_key = stf.type
+        WHERE st.is_deleted = 0 and state=0
+        <if test="stock.stype!=null and stock.stype != ''">
+            and stf.type = #{stock.stype}
+        </if>
+        <if test="stock.specsValue1!=null and stock.specsValue1 != ''">
+            and st.specs_value1 = #{stock.specsValue1}
+        </if>
+        <if test="stock.specsValue2!=null and stock.specsValue2 != ''">
+            and st.specs_value2 = #{stock.specsValue2}
+        </if>
+        <if test="stock.state!=null and stock.state != ''">
+            and st.state = #{stock.state}
+        </if>
+        <if test="stock.type!=null and stock.type != ''">
+            and st.type = #{stock.type}
+        </if>
+        <if test="stock.agrname!=null and stock.agrname != ''">
+            and stf.agricultural_name like concat('%', #{stock.agrname},'%')
+        </if>
+    </select>
     <!--入库出库-->
     <update id="UpdaeAmountc">
         update sys_stock

--
Gitblit v1.9.3