hym 4 سال پیش
والد
کامیت
27a4b220cf
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      src/main/resources/mapper/CommunityMapper.xml
  2. 2 2
      src/main/resources/mapper/GridManagementMapper.xml

+ 1 - 1
src/main/resources/mapper/CommunityMapper.xml

@@ -417,7 +417,7 @@
         <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="orgId != null"> and sc.org_id = #{orgId}</if>
+        <if test="orgId != null"> and sco.org_id = #{orgId}</if>
         order by sc.date_create desc
     </select>
     <select id="findByNameUnique" resultType="java.lang.Integer">

+ 2 - 2
src/main/resources/mapper/GridManagementMapper.xml

@@ -193,7 +193,7 @@
          sc_site_user ssu   join    sc_user a on ssu.user_id=a.id
          join sc_organization b on ssu.organ_id=b.id
         join sc_user_role d on d.uid=a.id join sc_role e on e.id=d.rid
-         left join (select count(*)peoples,user_id from sc_grid_management group by user_id)c
+         left join (select count(*)peoples,user_id from sc_grid_management where status=1 group by user_id)c
          on a.id=c.user_id
         <where>
             a.status=1 and d.status=1
@@ -231,7 +231,7 @@
     </select>
     <select id="getDevices" resultType="com.zoniot.ccrc.entity.Device">
         select * from sc_device where building_id=#{buildingId} and
-         id not in (select distinct device_id from sc_grid_management) and status=1
+         id not in (select distinct device_id from sc_grid_management where status=1) and status=1
         <if test="address != null  ">
             and loc_desc LIKE concat('%',#{address},'%')
         </if>