select f.id, f.bill_code as billCode, a.guid as ladingId, f.fee_level as feeLevel,
f.bill_fee_status as billFeeStatus, sc.sc_name as feeName, f.price, f.currency,
f.alloc_dim as allocDim
from srv_bill_air_fee f
left join srv_bill_air a on a.bill_code = f.bill_code
left join prc_surcharge sc on sc.sc_id = f.fee_type and ifnull(sc.is_del, '0') = '0'
where f.del_flag = '0'
and f.bill_fee_status = '0'
and f.bill_code in
#{code}
order by f.bill_code, f.id
select trim(e.air_no_old) as billCode, e.order_no as orderNo, e.bill_id as billId,
case
when ifnull(b.charge_weight, 0) > 0 then b.charge_weight
when ifnull(b.actual_weight, 0) > 0 then b.actual_weight
when ifnull(b.receive_weight, 0) > 0 then b.receive_weight
else 0
end as chargeWeight
from prc_order_bill_ext e
inner join prc_order_bill b on b.bill_id = e.bill_id
where trim(e.air_no_old) in
#{code}
order by e.air_no_old, e.order_no, e.bill_id
select bill_id as billId, pay_bill_id as payBillId
from prc_pay_bill
where bill_id in
#{id}
update srv_bill_air_fee
set bill_fee_status = '1',
alloc_flag = '1',
alloc_dim = '2',
update_by = #{updateBy},
update_time = #{updateTime}
where del_flag = '0'
and bill_fee_status = '0'
and id in
#{id}