过滤全部回款和未全部回款的合同

This commit is contained in:
mx 2025-03-14 20:07:54 +08:00
parent fc72952eca
commit 8f761d02de
2 changed files with 11 additions and 0 deletions

View File

@ -97,5 +97,9 @@ public class PsContractInfoQueryBo {
*/
private String isProxy;
/**
* 1全部回款 0未全部回款
*/
private Integer allReturn;
}

View File

@ -409,6 +409,13 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
log.info("托管服务");
}
QueryWrapper<PsContractInfo> 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);
}
Page<PsContractInfoVo> result = baseMapper.selectPageContractList(pageQuery.build(), lqw);
if(CollectionUtils.isEmpty(result.getRecords())){
return TableDataInfo.build(result);