insert into tb_bd_device(device_id,devic_type,status,device_name,create_time,bd_id,remarks,del_flag)
value (
#{deviceId},#{deviceModelId},0,#{deviceName},now(),#{gatewayId},#{description},0
)
insert into tb_warn (warn_time,warn_content,warn_type,bd_device,db_id,bid_code)
value (#{eventTime},#{eventDesc},#{eventCode},#{deviceId},#{gatewayId},#{bidCode})
replace into tb_device_value (attribute_id,val,create_time,is_warn,unit,change_val)
value(#{attributeId},#{value},#{dataTime},#{isWarn},#{unit},#{changeValue})
insert into(id, bid_code, attribute_id, val, create_time, is_warn, source_type,
source_data, change_val, unit)
values( #{id}, #{bidCode}, #{attributeId}, #{value}, #{dataTime}, #{isWarn},'边带数据上传',
#{sourceData},#{changeValue},#{unit}
)
update tb_pro_bd set bid_code=#{bidNo},bind_time=now() where bd_code=#{gatewayId};
update tb_bd_device set del_flag=1 where device_id=#{deviceId} and bd_id=#{gatewayId}
update tb_bd_device set status=#{state} where device_id=#{deviceId} and bd_id=#{gatewayId}