|
@@ -57,6 +57,35 @@
|
|
|
INNER JOIN sms_alarm_type sat on sad.alarm_id = sat.id
|
|
|
INNER JOIN sms_device sd on sd.id = sat.device_id
|
|
|
INNER JOIN sms_device_type dt on dt.id = sd.DEVICE_TYPE_ID
|
|
|
+ <where>
|
|
|
+ <if test="dto.alarmName != null and dto.alarmName!=''" >
|
|
|
+ and sat.`name` like concat('%', #{dto.alarmName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.alarmCategory != null and dto.alarmCategory!=''" >
|
|
|
+ and sat.alarm_category like concat('%', #{dto.alarmCategory}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.startTime != null">
|
|
|
+ and sad.alarm_start_time >=#{dto.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto.endTime != null">
|
|
|
+ and sad.alarm_end_time <= #{dto.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto.state != null">
|
|
|
+ and sad.state = #{dto.state}
|
|
|
+ </if>
|
|
|
+ <include refid="permissionCondition"></include>
|
|
|
+ order by sad.create_date desc
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectList" resultType="com.zcxk.water.api.vo.AlarmTypeDetailsEntityVo">
|
|
|
+ select
|
|
|
+ sat.`name` as alarmName, sad.scene_name, sd.DEVICE_NAME as deviceName,
|
|
|
+ CONCAT(dt.MANUFACTURER_NAME,"/",dt.DEVICE_TYPE,"/",dt.DEVICE_MODE) as productName,sat.`desc`,sd.ADDRESS as address, sad.alarm_start_time
|
|
|
+ from sms_alarm_details sad
|
|
|
+ INNER JOIN sms_alarm_type sat on sad.alarm_id = sat.id
|
|
|
+ INNER JOIN sms_device sd on sd.id = sat.device_id
|
|
|
+ INNER JOIN sms_device_type dt on dt.id = sd.DEVICE_TYPE_ID
|
|
|
<where>
|
|
|
<if test="dto.alarmName != null and dto.alarmName!=''" >
|
|
|
and sat.`name` like concat('%', #{dto.alarmName}, '%')
|