This commit is contained in:
mx 2025-03-20 15:44:15 +08:00
parent 912de74254
commit 0f81d8fe01

View File

@ -410,7 +410,7 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
}
QueryWrapper<PsContractInfo> lqw = buildQueryWrapper(bo);
if (bo.getAllReturn() != null){
String sql = "IFNULL((select sum(money) from ps_contract_pay where pay_status = 1 and business_type = 1 and contract_code = info.contract_code),0) - IFNULL((select sum(money) from ps_contract_pay where pay_status = 1 and business_type = 2 and contract_code = info.contract_code),0)";
String sql = "IFNULL((select sum(money) from ps_contract_pay where contract_code = info.contract_code and pay_status = 1 and business_type = 1),0) - IFNULL((select sum(money) from ps_contract_pay where contract_code = info.contract_code and pay_status = 1 and business_type = 2),0)";
if (bo.getAllReturn() == 1){
lqw.apply("info.contract_amount <= " + sql);
} else if (bo.getAllReturn() == 0) {