select r.rel_id, r.sc_id, r.product_id, r.product_code, r.detail_id,
r.created_by, r.create_time, r.updated_by, r.update_time,
s.sc_name, s.fee_type, s.charge_type, s.charge_value, s.currency,
s.round_mode, s.ss_code, s.country_code, s.sc_note,
c.country_name, c.weight_min, c.weight_max
from prc_surcharge_rel r
join prc_surcharge s on s.sc_id = r.sc_id
left join product_country c on c.detail_id = r.detail_id
insert into prc_surcharge_rel (
sc_id, product_id, product_code, detail_id,
created_by,
create_time
) values (
#{scId}, #{productId}, #{productCode}, #{detailId},
#{createBy},
sysdate()
)
delete from prc_surcharge_rel where rel_id in
#{relId}
delete from prc_surcharge_rel where product_code in
#{code}
update prc_surcharge_rel
set sc_id = #{newScId}, updated_by = #{operator}, update_time = sysdate()
where sc_id = #{oldScId}