From 97da879dc16dffb2fbcc7447dee7db819049fa02 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Sat, 15 Oct 2022 11:35:16 +0800
Subject: [PATCH] 农资查询添加模糊查询

---
 src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml b/src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml
index dcdc2d3..8c1aa58 100644
--- a/src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml
+++ b/src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml
@@ -12,15 +12,21 @@
 
     <select id="selectSalePage" resultMap="inventoryResultMap">
         select inventory.*,
-               strain.strain_name,bdb.dict_value
+               strain.strain_name,mach.machining_type AS proName,bdb.dict_value
         from sys_inventory inventory
         LEFT JOIN sys_strain strain on inventory.strain_id = strain.id
         LEFT JOIN blade_dict_biz bdb ON inventory.reason = bdb.dict_key
+        LEFT JOIN sys_land land ON land.id = inventory.land_id
+        LEFT JOIN sys_process_inv inv ON inv.id = inventory.prod_id
+        LEFT JOIN sys_machining mach ON mach.id = inv.product_id
         where
-        <if test="inventory.strainId !=null and inventory.strainId != '' ">
-            inventory.strain_id = #{inventory.strainId} AND
+        1=1
+        <if test="inventory.farmId != null and inventory.farmId !=''">
+            AND (land.farm_id = #{inventory.farmId} OR inv.fps_id = #{inventory.farmId})
         </if>
-              bdb.code = "lossReason" AND inventory.is_deleted = 0 ORDER BY inventory.create_time DESC
+            AND bdb.code = "lossReason"
+            AND inventory.is_deleted = 0
+            ORDER BY inventory.create_time DESC
     </select>
 
 </mapper>

--
Gitblit v1.9.3