select device_id, device_code, device_name, manufacturer, parent_id, ancestors, area_id, area_name, device_type_id, device_type_name, power_main_equ_flag, device_model, phy_asset_id, station_no, monitor_index_no, phase_num, phase, status, position_x, position_y, position_z, device_length, device_width, device_height, del_flag, create_by, create_time, update_by, update_time, order_num, old_device_id, old_parent_id, old_area_id, old_area_name from basedata_device insert into basedata_device device_code, device_name, manufacturer, parent_id, ancestors, area_id, area_name, device_type_id, device_type_name, power_main_equ_flag, device_model, phy_asset_id, station_no, monitor_index_no, phase_num, phase, status, position_x, position_y, position_z, device_length, device_width, device_height, del_flag, create_by, create_time, update_by, update_time, install_position, order_num, old_device_id, old_parent_id, old_area_id, old_area_name, #{deviceCode}, #{deviceName}, #{manufacturer}, #{parentId}, #{ancestors}, #{areaId}, #{areaName}, #{deviceTypeId}, #{deviceTypeName}, #{powerMainEquFlag}, #{deviceModel}, #{phyAssetId}, #{stationNo}, #{monitorIndexNo}, #{phaseNum}, #{phase}, #{status}, #{positionX}, #{positionY}, #{positionZ}, #{deviceLength}, #{deviceWidth}, #{deviceHeight}, #{delFlag}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{installPosition}, #{orderNum}, #{oldDeviceId}, #{oldParentId}, #{oldAreaId}, #{oldAreaName}, update basedata_device device_code = #{deviceCode}, device_name = #{deviceName}, manufacturer = #{manufacturer}, parent_id = #{parentId}, ancestors = #{ancestors}, area_id = #{areaId}, area_name = #{areaName}, device_type_id = #{deviceTypeId}, device_type_name = #{deviceTypeName}, power_main_equ_flag = #{powerMainEquFlag}, device_model = #{deviceModel}, phy_asset_id = #{phyAssetId}, station_no = #{stationNo}, monitor_index_no = #{monitorIndexNo}, phase_num = #{phaseNum}, phase = #{phase}, status = #{status}, position_x = #{positionX}, position_y = #{positionY}, position_z = #{positionZ}, device_length = #{deviceLength}, device_width = #{deviceWidth}, device_height = #{deviceHeight}, del_flag = #{delFlag}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, install_position = #{installPosition}, order_num = #{orderNum}, where device_id = #{deviceId} update basedata_device set relation_area_id = #{toAreaId} where device_id = #{deviceId} or parent_id = #{deviceId} delete from basedata_device where device_id = #{deviceId} delete from basedata_device where device_id in #{deviceId} delete from basedata_device where old_device_id like concat(#{sendCode},'%')