diff --git a/emis-biz/src/main/resources/mapper/EmisTmsCostProfitMapper.xml b/emis-biz/src/main/resources/mapper/EmisTmsCostProfitMapper.xml index 053e04d15..5219138ef 100644 --- a/emis-biz/src/main/resources/mapper/EmisTmsCostProfitMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisTmsCostProfitMapper.xml @@ -37,7 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.bill_code=b.bill_code and a.del_flag='0' and b.del_flag='0' and b.id = #{id} - and ( FIND_IN_SET(b.`bill_code`,#{billCode}) or FIND_IN_SET(b.`master_bill_code`,#{billCode}) ) + + and ( + FIND_IN_SET(b.`bill_code`,#{billCode}) or + exists ( + select 1 from emis_waybill c where c.master_bill_code = a.bill_code and FIND_IN_SET(c.`bill_code`,#{billCode}) + ) + ) and b.standard_fee = #{standardFee} and b.bill_fee = #{billFee} and b.cost_fee = #{costFee}