From 912de74254077c4d45913c3c7943ba3568e52f34 Mon Sep 17 00:00:00 2001 From: mx <1@qq.com> Date: Fri, 14 Mar 2025 20:43:06 +0800 Subject: [PATCH] 1 --- .../service/impl/PsContractInfoServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsContractInfoServiceImpl.java b/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsContractInfoServiceImpl.java index 0e57c66..6eca039 100644 --- a/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsContractInfoServiceImpl.java +++ b/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsContractInfoServiceImpl.java @@ -409,11 +409,13 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService { log.info("托管服务"); } QueryWrapper lqw = buildQueryWrapper(bo); - 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)"; - if (bo.getAllReturn() == 1){ - lqw.apply("info.contract_amount <= " + sql); - } else if (bo.getAllReturn() == 0) { - lqw.apply("info.contract_amount > " + sql); + 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)"; + if (bo.getAllReturn() == 1){ + lqw.apply("info.contract_amount <= " + sql); + } else if (bo.getAllReturn() == 0) { + lqw.apply("info.contract_amount > " + sql); + } } Page result = baseMapper.selectPageContractList(pageQuery.build(), lqw);