|  |  | 
 |  |  |                 new MPJLambdaWrapper<UnionApply>() | 
 |  |  |                         .selectAll(UnionApply.class) | 
 |  |  |                         .selectAs(Solutions::getName,UnionApply::getSolutionName) | 
 |  |  |                         .selectAs(Solutions::getDelOnlyReplace,UnionApply::getDelOnlyReplace) | 
 |  |  |                         .selectAs(Company::getName,UnionApply::getCompanyName) | 
 |  |  |                         .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.UNION_APPLY_ID = t.id ) as insureNum") | 
 |  |  |                 .select(" ( select count(DISTINCT(b.MEMBER_ID)) from apply_detail b inner join insurance_apply a on b.apply_id = a.id  and a.status in ( 5 , 27 )  where b.union_apply_id=t.id and b.END_TIME > now() ) as guaranteeNum") | 
 |  |  | 
 |  |  |         BigDecimal fee = BigDecimal.ZERO; | 
 |  |  |         for (ApplyDetail applyDetail:applyDetailList) { | 
 |  |  |             //查询人员信息是否存在相同的方案下是否存在 冲突数据 | 
 |  |  |             InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), | 
 |  |  |             InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), | 
 |  |  |                     applyDetail.getIdcardNo(),applyDetail.getMemberName(),unionApply.getStartTime(),unionApply.getEndTime(), | 
 |  |  |                     applyDetailJoinMapper); | 
 |  |  |  | 
 |  |  | 
 |  |  |                         .filter(m->Constants.equalsInteger(m.getApplyId(),(insuranceApply.getId()))).collect(Collectors.toList())) { | 
 |  |  |  | 
 |  |  |                     //查询人员信息是否存在相同的方案下是否存在 冲突数据 | 
 |  |  |                     InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), | 
 |  |  |                     InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), | 
 |  |  |                             applyDetail.getIdcardNo(),applyDetail.getMemberName(),unionApply.getStartTime(),unionApply.getEndTime(), | 
 |  |  |                             applyDetailJoinMapper); | 
 |  |  |  | 
 |  |  | 
 |  |  |                     applyDetail.setFee(price.multiply(new BigDecimal(maxDays)).add(serverCost)); | 
 |  |  |                     applyDetail.setStartTime(unionApplyBXDDTO.getStartTime()); | 
 |  |  |                     applyDetail.setEndTime(unionApplyBXDDTO.getEndTime()); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                     MemberInsurance memberInsurance = new MemberInsurance(applyDetail,user.getId()); | 
 |  |  |                     memberInsurance.setBdCode(unionApplyBXDDTO.getCode()); | 
 |  |  |                     memberInsurance.setRelationType(Constants.ZERO); |