select bill_id, bill_key, order_no, tracking_no, customer_id, customer_code, customer_name,
pieces, actual_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, order_remark,
product_code, product_name, country_code, country_name, weight, biz_date, tms_id,
match_source, match_message, price_set_id, price_set_code, price_set_name,
set_type, bind_priority, customer_priceset_id, product_country_id,
weight_min, weight_max, weight_label, effective_date, charge_weight,
freight_rate, base_freight_rate, discount_percent, registration_fee,
freight_amount, surcharge_amount, payable_total, currency, round_mode,
created_by, created_at, updated_by, updated_at
from prc_bill
insert into prc_bill (
bill_id, bill_key, order_no, tracking_no, customer_id, customer_code, customer_name,
pieces, actual_weight, volume, volume_weight, pkg_length, pkg_width, pkg_height,
shipper_name, consignee_name, dest_postcode, warehouse_code, order_time, order_remark,
product_code, product_name, country_code, country_name, weight, biz_date, tms_id,
match_source, match_message, price_set_id, price_set_code, price_set_name,
set_type, bind_priority, customer_priceset_id, product_country_id,
weight_min, weight_max, weight_label, effective_date, charge_weight,
freight_rate, base_freight_rate, discount_percent, registration_fee,
freight_amount, surcharge_amount, payable_total, currency, round_mode,
created_at
) values (
#{billId}, #{billKey}, #{orderNo}, #{trackingNo}, #{customerId}, #{customerCode}, #{customerName},
#{pieces}, #{actualWeight}, #{volume}, #{volumeWeight}, #{pkgLength}, #{pkgWidth}, #{pkgHeight},
#{shipperName}, #{consigneeName}, #{destPostcode}, #{warehouseCode}, #{orderTime}, #{orderRemark},
#{productCode}, #{productName}, #{countryCode}, #{countryName}, #{weight}, #{bizDate}, #{tmsId},
#{matchSource}, #{matchMessage}, #{priceSetId}, #{priceSetCode}, #{priceSetName},
#{setType}, #{bindPriority}, #{customerPricesetId}, #{productCountryId},
#{weightMin}, #{weightMax}, #{weightLabel}, #{effectiveDate}, #{chargeWeight},
#{freightRate}, #{baseFreightRate}, #{discountPercent}, #{registrationFee},
#{freightAmount}, #{surchargeAmount}, #{payableTotal}, #{currency}, #{roundMode},
sysdate()
)
update prc_bill
set bill_key = #{billKey},
tracking_no = #{trackingNo},
customer_id = #{customerId},
customer_code = #{customerCode},
customer_name = #{customerName},
pieces = #{pieces},
actual_weight = #{actualWeight},
volume = #{volume},
volume_weight = #{volumeWeight},
pkg_length = #{pkgLength},
pkg_width = #{pkgWidth},
pkg_height = #{pkgHeight},
shipper_name = #{shipperName},
consignee_name = #{consigneeName},
dest_postcode = #{destPostcode},
warehouse_code = #{warehouseCode},
order_time = #{orderTime},
order_remark = #{orderRemark},
product_code = #{productCode},
product_name = #{productName},
country_code = #{countryCode},
country_name = #{countryName},
weight = #{weight},
biz_date = #{bizDate},
tms_id = #{tmsId},
match_source = #{matchSource},
match_message = #{matchMessage},
price_set_id = #{priceSetId},
price_set_code = #{priceSetCode},
price_set_name = #{priceSetName},
set_type = #{setType},
bind_priority = #{bindPriority},
customer_priceset_id = #{customerPricesetId},
product_country_id = #{productCountryId},
weight_min = #{weightMin},
weight_max = #{weightMax},
weight_label = #{weightLabel},
effective_date = #{effectiveDate},
charge_weight = #{chargeWeight},
freight_rate = #{freightRate},
base_freight_rate = #{baseFreightRate},
discount_percent = #{discountPercent},
registration_fee = #{registrationFee},
freight_amount = #{freightAmount},
surcharge_amount = #{surchargeAmount},
payable_total = #{payableTotal},
currency = #{currency},
round_mode = #{roundMode},
updated_at = sysdate()
where bill_id = #{billId}
update prc_bill
set surcharge_amount = #{surchargeAmount},
payable_total = #{payableTotal},
updated_at = sysdate()
where bill_id = #{billId}