瀏覽代碼

津南精细化服务平台

lin 3 年之前
父節點
當前提交
1954141851
共有 2 個文件被更改,包括 8 次插入12 次删除
  1. 3 7
      src/main/resources/mapper/DeviceMapper.xml
  2. 5 5
      src/main/resources/mapper/WarningLogMapper.xml

+ 3 - 7
src/main/resources/mapper/DeviceMapper.xml

@@ -489,7 +489,6 @@
   <select id="getList" resultType="com.zoniot.ccrc.dto.DeviceDto">
     select
         sd.*,
-        sb.name as building_name,
         sc.name as community_name,
         so.name as org_name,
         sdt.equipment_type,
@@ -502,7 +501,6 @@
         sgm.label,
         su.username
     from sc_device sd
-    left join sc_building sb on(sb.id = sd.building_id)
     left join sc_community sc on(sc.id = sd.community_id)
     left join sc_organization so on(so.id = sc.org_id)
     left join sc_device_type sdt on(sdt.id = sd.device_type_id)
@@ -515,9 +513,9 @@
     <if test="sysId != null"> and sd.sys_id = #{sysId}</if>
     <if test="deviceTypeId != null"> and sd.device_type_id = #{deviceTypeId}</if>
     <if test="orgId != null"> and sc.org_id = #{orgId}</if>
-    <if test="province != null"> and sb.province = #{province}</if>
-    <if test="city != null"> and sb.city = #{city}</if>
-    <if test="region != null"> and sb.region = #{region}</if>
+    <if test="province != null"> and sc.province = #{province}</if>
+    <if test="city != null"> and sc.city = #{city}</if>
+    <if test="region != null"> and sc.region = #{region}</if>
     <if test="communityId != null"> and sd.community_id = #{communityId}</if>
     <if test="buildingId != null"> and sd.building_id = #{buildingId}</if>
     <if test="deviceNo != null and deviceNo != ''"> AND (sd.device_no LIKE concat('%',#{deviceNo},'%') or sd.meter_no LIKE concat('%',#{deviceNo},'%') or sd.file_no LIKE concat('%',#{deviceNo},'%'))</if>
@@ -650,7 +648,6 @@
   <select id="findDeviceDetail" resultType="com.zoniot.ccrc.dto.DeviceDto">
     select
             sd.*,
-            sb.name as building_name,
             sc.name as community_name,
             so.name as org_name,
             sdt.equipment_type,
@@ -663,7 +660,6 @@
             sgm.label,
             su.username
     from sc_device sd
-                 left join sc_building sb on(sb.id = sd.building_id)
                  left join sc_community sc on(sc.id = sd.community_id)
                  left join sc_organization so on(so.id = sc.org_id)
                  left join sc_device_type sdt on(sdt.id = sd.device_type_id)

+ 5 - 5
src/main/resources/mapper/WarningLogMapper.xml

@@ -142,7 +142,7 @@
     sgm.customer_phone accountPhone
     from sc_warning_log swl
     left join sc_device sd on(sd.id = swl.device_id)
-    left join sc_building sb on(sb.id = sd.building_id)
+    left join sc_community sc on(sc.id = sd.community_id)
     left join sc_device_type sdt1 on(sdt1.id = sd.device_type_id)
     left join sc_device_manufacturer sdm1 on(sdm1.id = sdt1.manufacturer_id)
     left join sc_grid_management sgm on(sgm.device_id = sd.id and sgm.status = 1)
@@ -159,10 +159,10 @@
       sgm.customer_name LIKE concat('%',#{clientName},'%') or sgm.customer_phone LIKE concat('%',#{clientName},'%') or sgm.customer_no LIKE concat('%',#{clientName},'%')
     )</if>
     <if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
-    <if test="provinceId != null"> and sb.province = #{provinceId}</if>
-    <if test="cityId != null"> and sb.city = #{cityId}</if>
-    <if test="regionId != null"> and sb.region = #{regionId}</if>
-    <if test="communityId != null"> and sb.community_id = #{communityId}</if>
+    <if test="provinceId != null"> and sc.province = #{provinceId}</if>
+    <if test="cityId != null"> and sc.city = #{cityId}</if>
+    <if test="regionId != null"> and sc.region = #{regionId}</if>
+    <if test="communityId != null"> and sc.id = #{communityId}</if>
     <if test="buildingId != null"> and sd.building_id = #{buildingId}</if>
     <if test="startDate != null"> and swl.date_create <![CDATA[ >= ]]> #{startDate}</if>
     <if test="endDate != null"> and swl.date_create <![CDATA[ <= ]]> #{endDate}</if>