| | |
| | | @Repository |
| | | public interface DeviceAlarmMapper { |
| | | |
| | | @Insert("INSERT INTO device_alarm (deviceId, channelId, alarmPriority, alarmMethod, alarmTime, alarmDescription, longitude, latitude, alarmType , createTime ) " + |
| | | @Insert("INSERT INTO wvp_device_alarm (device_id, channel_id, alarm_priority, alarm_method, alarm_time, alarm_description, longitude, latitude, alarm_type , create_time ) " + |
| | | "VALUES (#{deviceId}, #{channelId}, #{alarmPriority}, #{alarmMethod}, #{alarmTime}, #{alarmDescription}, #{longitude}, #{latitude}, #{alarmType}, #{createTime})") |
| | | int add(DeviceAlarm alarm); |
| | | |
| | | |
| | | @Select( value = {" <script>" + |
| | | " SELECT * FROM device_alarm " + |
| | | " SELECT * FROM wvp_device_alarm " + |
| | | " WHERE 1=1 " + |
| | | " <if test=\"deviceId != null\" > AND deviceId = #{deviceId}</if>" + |
| | | " <if test=\"alarmPriority != null\" > AND alarmPriority = #{alarmPriority} </if>" + |
| | | " <if test=\"alarmMethod != null\" > AND alarmMethod = #{alarmMethod} </if>" + |
| | | " <if test=\"alarmType != null\" > AND alarmType = #{alarmType} </if>" + |
| | | " <if test=\"startTime != null\" > AND alarmTime >= #{startTime} </if>" + |
| | | " <if test=\"endTime != null\" > AND alarmTime <= #{endTime} </if>" + |
| | | " ORDER BY alarmTime ASC " + |
| | | " <if test=\"deviceId != null\" > AND device_id = #{deviceId}</if>" + |
| | | " <if test=\"alarmPriority != null\" > AND alarm_priority = #{alarmPriority} </if>" + |
| | | " <if test=\"alarmMethod != null\" > AND alarm_method = #{alarmMethod} </if>" + |
| | | " <if test=\"alarmType != null\" > AND alarm_type = #{alarmType} </if>" + |
| | | " <if test=\"startTime != null\" > AND alarm_time >= #{startTime} </if>" + |
| | | " <if test=\"endTime != null\" > AND alarm_time <= #{endTime} </if>" + |
| | | " ORDER BY alarm_time ASC " + |
| | | " </script>"}) |
| | | List<DeviceAlarm> query(String deviceId, String alarmPriority, String alarmMethod, |
| | | String alarmType, String startTime, String endTime); |
| | | |
| | | |
| | | @Delete(" <script>" + |
| | | "DELETE FROM device_alarm WHERE 1=1 " + |
| | | " <if test=\"deviceIdList != null and id == null \" > AND deviceId in " + |
| | | "DELETE FROM wvp_device_alarm WHERE 1=1 " + |
| | | " <if test=\"deviceIdList != null and id == null \" > AND device_id in " + |
| | | "<foreach collection='deviceIdList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + |
| | | "</if>" + |
| | | " <if test=\"time != null and id == null \" > AND alarmTime <= #{time}</if>" + |
| | | " <if test=\"time != null and id == null \" > AND alarm_time <= #{time}</if>" + |
| | | " <if test=\"id != null\" > AND id = #{id}</if>" + |
| | | " </script>" |
| | | ) |