54 lines
2.5 KiB
XML
54 lines
2.5 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.bms.price.mapper.SrvBillAirAllocMapper">
|
|
|
|
<select id="selectPendingFees" resultType="com.bms.price.airbill.domain.SrvBillAirAllocFee">
|
|
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
|
|
<foreach collection="billCodes" item="code" open="(" separator="," close=")">#{code}</foreach>
|
|
order by f.bill_code, f.id
|
|
</select>
|
|
|
|
<select id="selectOrders" resultType="com.bms.price.airbill.domain.SrvBillAirAllocOrder">
|
|
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
|
|
<foreach collection="billCodes" item="code" open="(" separator="," close=")">#{code}</foreach>
|
|
order by e.air_no_old, e.order_no, e.bill_id
|
|
</select>
|
|
|
|
<select id="selectPayBills" resultType="com.bms.price.domain.PrcPayBill">
|
|
select bill_id as billId, pay_bill_id as payBillId
|
|
from prc_pay_bill
|
|
where bill_id in
|
|
<foreach collection="billIds" item="id" open="(" separator="," close=")">#{id}</foreach>
|
|
</select>
|
|
|
|
<update id="markAllocated">
|
|
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
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">#{id}</foreach>
|
|
</update>
|
|
</mapper>
|