select thisTab.id, thisTab.system_code, thisTab.quote_plan_id, thisTab.quote_plan_code, thisTab.vehicle_provider_id, thisTab.vehicle_provider_name, thisTab.transport_route, thisTab.start_region_code, thisTab.start_region, thisTab.start_warehouse, thisTab.end_region_code, thisTab.end_region, thisTab.end_warehouse, thisTab.vehicle_type, thisTab.transport_mode, thisTab.route_type, thisTab.freight_price, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark,thisTab.plan_type, thisTab.customer_id , thisTab.currency, thisTab.tax_rate, thisTab.is_segmented_invoice, thisTab.segment1_freight_quote, thisTab.segment1_currency, thisTab.segment1_tax_rate, thisTab.segment2_freight_quote, thisTab.segment2_currency, thisTab.segment2_tax_rate, thisTab.total_freight_cny, thisTab.total_freight_hkd from tms_quote_detail AS thisTab select count(0) from tms_quote_detail as thisTab and thisTab.system_code = #{systemCode} and thisTab.quote_plan_id = #{quotePlanId} and thisTab.quote_plan_code = #{quotePlanCode} and thisTab.vehicle_provider_id = #{vehicleProviderId} and thisTab.vehicle_provider_name like concat('%', #{vehicleProviderName}, '%') and thisTab.transport_route = #{transportRoute} and thisTab.start_region_code = #{startRegionCode} and thisTab.start_region = #{startRegion} and thisTab.start_warehouse = #{startWarehouse} and thisTab.end_region_code = #{endRegionCode} and thisTab.end_region = #{endRegion} and thisTab.end_warehouse = #{endWarehouse} and thisTab.vehicle_type = #{vehicleType} and thisTab.transport_mode = #{transportMode} and thisTab.route_type = #{routeType} and thisTab.freight_price = #{freightPrice} and thisTab.status = #{status} and thisTab.plan_type = #{planType} and thisTab.customer_id = #{customerId} and thisTab.currency = #{currency} and thisTab.tax_rate = #{taxRate} and thisTab.is_segmented_invoice = #{isSegmentedInvoice} and thisTab.segment1_freight_quote = #{segment1FreightQuote} and thisTab.segment1_currency = #{segment1Currency} and thisTab.segment1_tax_rate = #{segment1TaxRate} and thisTab.segment2_freight_quote = #{segment2FreightQuote} and thisTab.segment2_currency = #{segment2Currency} and thisTab.segment2_tax_rate = #{segment2TaxRate} and thisTab.total_freight_cny = #{totalFreightCny} and thisTab.total_freight_hkd = #{totalFreightHkd} insert into tms_quote_detail system_code, quote_plan_id, quote_plan_code, vehicle_provider_id, vehicle_provider_name, transport_route, start_region_code, start_region, start_warehouse, end_region_code, end_region, end_warehouse, vehicle_type, transport_mode, route_type, freight_price, status, create_by, create_time, update_by, update_time, remark, plan_type, customer_id, currency, tax_rate, is_segmented_invoice, segment1_freight_quote, segment1_currency, segment1_tax_rate, segment2_freight_quote, segment2_currency, segment2_tax_rate, total_freight_cny, total_freight_hkd, #{systemCode}, #{quotePlanId}, #{quotePlanCode}, #{vehicleProviderId}, #{vehicleProviderName}, #{transportRoute}, #{startRegionCode}, #{startRegion}, #{startWarehouse}, #{endRegionCode}, #{endRegion}, #{endWarehouse}, #{vehicleType}, #{transportMode}, #{routeType}, #{freightPrice}, #{status}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{planType}, #{customerId}, #{currency}, #{taxRate}, #{isSegmentedInvoice}, #{segment1FreightQuote}, #{segment1Currency}, #{segment1TaxRate}, #{segment2FreightQuote}, #{segment2Currency}, #{segment2TaxRate}, #{totalFreightCny}, #{totalFreightHkd}, insert into tms_quote_detail id,system_code,quote_plan_id,quote_plan_code,vehicle_provider_id,vehicle_provider_name,transport_route,start_region_code,start_region,start_warehouse,end_region_code,end_region,end_warehouse,vehicle_type,transport_mode,route_type,freight_price,status,create_by,create_time,update_by,update_time,remark,plan_type,customer_id,currency,tax_rate,is_segmented_invoice,segment1_freight_quote,segment1_currency,segment1_tax_rate,segment2_freight_quote,segment2_currency,segment2_tax_rate,total_freight_cny,total_freight_hkd, #{item.id},#{item.systemCode},#{item.quotePlanId},#{item.quotePlanCode},#{item.vehicleProviderId},#{item.vehicleProviderName},#{item.transportRoute},#{item.startRegionCode},#{item.startRegion},#{item.startWarehouse},#{item.endRegionCode},#{item.endRegion},#{item.endWarehouse},#{item.vehicleType},#{item.transportMode},#{item.routeType},#{item.freightPrice},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.planType},#{item.customerId},#{item.currency},#{item.taxRate},#{item.isSegmentedInvoice},#{item.segment1FreightQuote},#{item.segment1Currency},#{item.segment1TaxRate},#{item.segment2FreightQuote},#{item.segment2Currency},#{item.segment2TaxRate},#{item.totalFreightCny},#{item.totalFreightHkd}, update tms_quote_detail system_code = #{systemCode}, quote_plan_id = #{quotePlanId}, quote_plan_code = #{quotePlanCode}, vehicle_provider_id = #{vehicleProviderId}, vehicle_provider_name = #{vehicleProviderName}, transport_route = #{transportRoute}, start_region_code = #{startRegionCode}, start_region = #{startRegion}, start_warehouse = #{startWarehouse}, end_region_code = #{endRegionCode}, end_region = #{endRegion}, end_warehouse = #{endWarehouse}, vehicle_type = #{vehicleType}, transport_mode = #{transportMode}, route_type = #{routeType}, freight_price = #{freightPrice}, status = #{status}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, plan_type = #{planType}, customer_id = #{customerId}, currency = #{currency}, tax_rate = #{taxRate}, is_segmented_invoice = #{isSegmentedInvoice}, segment1_freight_quote = #{segment1FreightQuote}, segment1_currency = #{segment1Currency}, segment1_tax_rate = #{segment1TaxRate}, segment2_freight_quote = #{segment2FreightQuote}, segment2_currency = #{segment2Currency}, segment2_tax_rate = #{segment2TaxRate}, total_freight_cny = #{totalFreightCny}, total_freight_hkd = #{totalFreightHkd}, where id = #{id} update tms_quote_detail system_code = #{item.systemCode}, quote_plan_id = #{item.quotePlanId}, quote_plan_code = #{item.quotePlanCode}, vehicle_provider_id = #{item.vehicleProviderId}, vehicle_provider_name = #{item.vehicleProviderName}, transport_route = #{item.transportRoute}, start_region_code = #{item.startRegionCode}, start_region = #{item.startRegion}, start_warehouse = #{item.startWarehouse}, end_region_code = #{item.endRegionCode}, end_region = #{item.endRegion}, end_warehouse = #{item.endWarehouse}, vehicle_type = #{item.vehicleType}, transport_mode = #{item.transportMode}, route_type = #{item.routeType}, freight_price = #{item.freightPrice}, status = #{item.status}, create_by = #{item.createBy}, create_time = #{item.createTime}, update_by = #{item.updateBy}, update_time = #{item.updateTime}, remark = #{item.remark}, plan_type = #{item.planType}, customer_id = #{item.customerId}, currency = #{item.currency}, tax_rate = #{item.taxRate}, is_segmented_invoice = #{item.isSegmentedInvoice}, segment1_freight_quote = #{item.segment1FreightQuote}, segment1_currency = #{item.segment1Currency}, segment1_tax_rate = #{item.segment1TaxRate}, segment2_freight_quote = #{item.segment2FreightQuote}, segment2_currency = #{item.segment2Currency}, segment2_tax_rate = #{item.segment2TaxRate}, total_freight_cny = #{item.totalFreightCny}, total_freight_hkd = #{item.totalFreightHkd}, where id = #{item.id} delete from tms_quote_detail where id = #{id} delete from tms_quote_detail where id in #{id}