diff --git a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml index a4f0b4ce8..f6559b929 100644 --- a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml @@ -466,7 +466,9 @@ and( ( - ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,6,7)) + IFNULL(`pay`,'0') <= 0 + or + ( starttime >= #{starttime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,6,7)) or ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,6,7)) )