select id, iot_device_id, group_id, product_id, stake_mark, direction, device_name, device_code, device_type, installation_Date, production_date, durable_years, installation_site, use_state, device_state, other_config, remark, create_time, update_time, facilities_type, device_ip, stake_mark_range, network_segment, device_img, child_type from dc_device insert into dc_door_monitor id, stake_mark, direction, device_type, device_name, operate, create_time, iot_device_id, #{id}, #{stakeMark}, #{direction}, #{deviceType}, #{deviceName}, #{operate}, #{createTime}, #{iotDeviceId}, insert into dc_smoke_record id, stake_mark, direction, device_type, device_name, smoke_value, create_time, iot_device_id, push_time, #{id}, #{stakeMark}, #{direction}, #{deviceType}, #{deviceName}, #{smokeValue}, #{createTime}, #{iotDeviceId}, #{pushTime}, insert into dc_snmp_alarm id, device_name, content, create_time, iot_device_id, ip, #{id}, #{deviceName}, #{content}, #{createTime}, #{iotDeviceId}, #{ip}, update dc_device set device_state=#{deviceState} where id=#{id} UPDATE dc_smoke_record smoke_value = #{smokeValue}, update_time = #{updateTime}, push_time = #{pushTime}, WHERE id = ( SELECT id FROM ( SELECT id FROM dc_smoke_record WHERE iot_device_id = #{iotDeviceId} ORDER BY create_time DESC LIMIT 1 ) AS latest_record ); UPDATE dc_snmp_alarm content = #{content}, update_time = #{updateTime}, WHERE id = ( SELECT id FROM ( SELECT id FROM dc_snmp_alarm WHERE iot_device_id = #{iotDeviceId} ORDER BY create_time DESC LIMIT 1 ) AS latest_record );