From a09e361bfcb68a809e9143eca87bed2d66af2216 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Mon, 25 Nov 2024 11:35:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/org/springblade/modules/yw/mapper/EmergencySuppliesMapper.xml |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/springblade/modules/yw/mapper/EmergencySuppliesMapper.xml b/src/main/java/org/springblade/modules/yw/mapper/EmergencySuppliesMapper.xml
index 08f3869..5a133e1 100644
--- a/src/main/java/org/springblade/modules/yw/mapper/EmergencySuppliesMapper.xml
+++ b/src/main/java/org/springblade/modules/yw/mapper/EmergencySuppliesMapper.xml
@@ -24,9 +24,10 @@
         select
         yes.*,
         yfi.name as firmName,
-        ys.per_in_cha as personInCha,ys.per_in_cha_pho as personInChaPhone,
+        ys.per_in_cha as personInCha,ys.per_in_cha_pho as personInChaPhone,ys.address supAdd,
+        ys.lng,ys.lat,
         bdb.dict_value as emeSupType,
-        concat(yes.num,bdb1.dict_value) as numUnit
+        concat(yes.num,ifnull(bdb1.dict_value,'')) as numUnit
         from
         yw_emergency_supplies yes
         left join yw_supplies ys on ys.id = yes.supplies_id and ys.is_deleted = 0
@@ -43,6 +44,33 @@
         <if test="emergencySupplies.type!=null">
             and yes.type = #{emergencySupplies.type}
         </if>
+        <if test="emergencySupplies.ownership!=null">
+            <if test="emergencySupplies.ownership==1">
+                and yes.firm_id is null
+            </if>
+            <if test="emergencySupplies.ownership==2">
+                and yes.firm_id is not null
+            </if>
+        </if>
+    </select>
+
+    <!--查询企业对应的应急物资信息-->
+    <select id="getEmergencySuppliesList" resultType="org.springblade.modules.yw.vo.EmergencySuppliesVO">
+        select
+        yes.*,
+        yfi.name as firmName,
+        ys.per_in_cha as personInCha,ys.per_in_cha_pho as personInChaPhone,ys.address supAdd,
+        ys.lng,ys.lat,
+        bdb.dict_value as emeSupType,
+        concat(yes.num,ifnull(bdb1.dict_value,'')) as numUnit
+        from
+        yw_emergency_supplies yes
+        left join yw_supplies ys on ys.id = yes.supplies_id and ys.is_deleted = 0
+        left join yw_firm_info yfi on yfi.id = yes.firm_id and yfi.is_deleted = 0
+        left join blade_dict_biz bdb on bdb.dict_key = yes.type and bdb.code = 'eme_sup_type'
+        left join blade_dict_biz bdb1 on bdb1.dict_key = yes.unit and bdb1.code = 'unit'
+        where yes.is_deleted = 0
+        and yes.firm_id = #{emergencySupplies.firmId}
     </select>
 
 </mapper>

--
Gitblit v1.9.3