select id, index_id, index_name, item_id, limiting_value, alarm_value, alarm_value_quality, begin_time, end_time, duration, content from history_alarm delete from realtime_alarm where alarm_code = #{alarmCode}; insert into history_alarm id, index_id, index_name, item_id, limiting_value, alarm_value, alarm_value_quality, begin_time, end_time, duration, content, time_code, alarm_code, #{historyAlarm.id}, #{historyAlarm.indexId}, #{historyAlarm.indexName}, #{historyAlarm.itemId}, #{historyAlarm.limitingValue}, #{historyAlarm.alarmValue}, #{historyAlarm.alarmValueQuality}, #{historyAlarm.beginTime}, #{historyAlarm.endTime}, #{historyAlarm.duration}, #{historyAlarm.content}, #{historyAlarm.timeCode}, #{historyAlarm.alarmCode}, ; delete from history_alarm where id = #{id} delete from history_alarm where id in #{id}