|
@@ -31,10 +31,10 @@
|
|
|
|
|
|
<!-- 外联表 -->
|
|
|
<sql id="leftJoins">
|
|
|
- left join sms_device t2 on t1.device_id=t2.id
|
|
|
- left join sms_scene t3 on t2.scene_id=t3.id
|
|
|
- left join sms_device_attribute t4 on t1.attribute_id=t4.id
|
|
|
- left join sms_device_type t5 on t2.device_type_id=t5.id
|
|
|
+ left join sms_device t2 on t1.device_id=t2.id and t2.status =1
|
|
|
+ left join sms_scene t3 on t2.scene_id=t3.id and t3.status =1
|
|
|
+ left join sms_device_attribute t4 on t1.attribute_id=t4.id and t4.status =1
|
|
|
+ left join sms_device_type t5 on t2.device_type_id=t5.id and t5.status =1
|
|
|
</sql>
|
|
|
|
|
|
<select id="findPage" resultMap="alarmSettingMap">
|
|
@@ -59,16 +59,16 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- and t1.STATUS =1
|
|
|
+ and t1.status =1
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAttributes" resultMap="alarmSettingMap">
|
|
|
select t3.id attribute_id,t3.name attribute_name
|
|
|
from sms_device t1
|
|
|
- inner join sms_device_type t2 on t1.device_type_id=t2.id
|
|
|
- inner join sms_device_attribute t3 on t2.id=t3.device_type_id
|
|
|
- where t1.id=#{deviceId} and t3.status=1
|
|
|
+ inner join sms_device_type t2 on t1.device_type_id=t2.id and t2.status =1
|
|
|
+ inner join sms_device_attribute t3 on t2.id=t3.device_type_id and t3.status =1
|
|
|
+ where t1.id=#{deviceId} and t1.status=1
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|