|
@@ -61,7 +61,12 @@
|
|
|
from sms_device d
|
|
|
left join sms_device_type t on d.DEVICE_TYPE_ID = t.id
|
|
|
<if test="deviceDto.sceneId!= null and deviceDto.sceneId != 0 ">
|
|
|
- inner join sms_device_scene s on s.DEVICE_ID=d.ID and s.SCENE_ID=#{deviceDto.sceneId} and s.status=1
|
|
|
+ <if test="deviceDto.searchType == null or deviceDto.searchType == 0 ">
|
|
|
+ inner join sms_device_scene s on s.DEVICE_ID=d.ID and (s.SCENE_ID=#{deviceDto.sceneId} or s.parent_scene_id = #{deviceDto.sceneId}) and s.status=1
|
|
|
+ </if>
|
|
|
+ <if test="deviceDto.searchType != null and deviceDto.searchType == 1 ">
|
|
|
+ inner join sms_device_scene s on s.DEVICE_ID=d.ID and s.SCENE_ID=#{deviceDto.sceneId} and s.status=1
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="deviceDto.sceneIds!= null and deviceDto.sceneIds.size()>0 ">
|
|
|
inner join sms_device_scene s on s.DEVICE_ID=d.ID and s.status=1 and s.SCENE_ID in
|