优化报警信息入库逻辑

This commit is contained in:
lin 2026-04-07 09:30:26 +08:00
parent 149c5a550b
commit 280ed4aee3
2 changed files with 3 additions and 4 deletions

View File

@ -31,7 +31,6 @@ import org.springframework.stereotype.Service;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
@Slf4j

View File

@ -43,11 +43,11 @@ public interface AlarmMapper {
@Insert("<script>" +
"INSERT INTO wvp_alarm (channel_id, description, snap_path, record_path, longitude, latitude, alarm_type, alarm_time)" +
" VALUES " +
"<foreach collection='handlerCatchDataList' item='item' open='(' separator=',' close=')'>" +
"#{item.channelId}, #{item.description}, #{item.snapPath}, #{item.recordPath}, #{item.longitude}, #{item.latitude}, #{item.alarmType}, #{item.alarmTime}" +
"<foreach collection='handlerCatchDataList' item='item' separator=','>" +
"(#{item.channelId}, #{item.description}, #{item.snapPath}, #{item.recordPath}, #{item.longitude}, #{item.latitude}, #{item.alarmType}, #{item.alarmTime})" +
"</foreach>" +
"</script>")
void insertAlarms(List<Alarm> handlerCatchDataList);
void insertAlarms(@Param("handlerCatchDataList") List<Alarm> handlerCatchDataList);
@Select("SELECT snap_path FROM wvp_alarm WHERE id = #{id}")
String getSnapPathById(@Param("id") Long id);