|
@@ -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>
|