From d849352441eaf2ef3398eb25cd0f933ff59beec9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 12 五月 2023 10:37:03 +0800 Subject: [PATCH] 重构以适配postgresql --- src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java index f927d51..28a2e91 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java @@ -16,32 +16,32 @@ @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>" ) -- Gitblit v1.8.0