|
@@ -698,9 +698,8 @@
|
|
|
,ad.ALARM_TYPE as "alarmType"
|
|
|
,d.DEVICE_NAME as "deviceName"
|
|
|
,da.NAME as "attributeName"
|
|
|
- ,CONCAT(asr.operator,asr.value) as "alarmContent"
|
|
|
+ ,(select GROUP_CONCAT(t12.relation , ' ',t12.operator,' ',t12.value, ' ' SEPARATOR '') as `alarm_range` from sms_alarm_rule t12 where t12.alarm_type_id = ast.id) alarmContent
|
|
|
,da.UNIT as "unit"
|
|
|
-
|
|
|
,d.id as "deviceId"
|
|
|
,d.TENANT_ID as "tenantId"
|
|
|
,d.COMPANY_ORG_ID as "companyOrgId"
|
|
@@ -713,9 +712,9 @@
|
|
|
left join sms_device d on ad.DEVICE_ID =d.ID
|
|
|
left join sms_device_attribute da on ad.ATTRIBUTE_ID =da.id
|
|
|
left join sms_alarm_type ast on ast.id=ad.ALARM_ID
|
|
|
- left join sms_alarm_rule asr on ast.id= asr.alarm_type_id
|
|
|
- where ad.OP_STATE=1 and ad.STATE=1 and ad.is_send_message = 0 and d.status = 1 and d.ENABLE_STATE = 1
|
|
|
- and timestampdiff(MINUTE,ad.ALARM_START_TIME,now())>10
|
|
|
+ left join sms_alarm_rule ar on ar.alarm_type_id=ast.id
|
|
|
+ where ad.OP_STATE = 1 and ad.STATE=1 and ad.is_send_message = 0 and d.status = 1 and d.ENABLE_STATE = 2
|
|
|
+ and timestampdiff(MINUTE,ad.ALARM_START_TIME,now()) > 10
|
|
|
</select>
|
|
|
|
|
|
<update id="updateAlarmSendMessageState" >
|