|  |  | 
 |  |  |         queryWrapper.selectAs(Solutions::getPrice,InsuranceApply::getPrice); | 
 |  |  |         queryWrapper.selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit); | 
 |  |  |         queryWrapper.select(" DATEDIFF( t.END_TIME ,now()  ) AS loseEfficacyDays  "); | 
 |  |  |         queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id ) as insureNum"); | 
 |  |  |         queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id   ) as insureNum"); | 
 |  |  |         queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id and ad.END_TIME > now() ) as guaranteeNum"); | 
 |  |  |         if(!Objects.isNull(pageWrap.getModel())&&!Objects.isNull(pageWrap.getModel().getType())){ | 
 |  |  |             queryWrapper.select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney"); | 
 |  |  |             queryWrapper.select(" ( select td.CREATE_DATE from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status = 1 and td.INSURANCE_APPLY_ID = t.id order by td.CREATE_DATE desc limit 1 ) as taxesLast "); | 
 |  |  | 
 |  |  |                 .selectAs(Company::getName,InsuranceApply::getCompanyName) | 
 |  |  |                 .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac  where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate") | 
 |  |  |                 .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id ) as insureNum") | 
 |  |  |                 .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id and ad.END_TIME > now() ) as guaranteeNum") | 
 |  |  |                 .select(" t3.name as shopName") | 
 |  |  |                 .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) | 
 |  |  |                 .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) | 
 |  |  | 
 |  |  |                 .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) | 
 |  |  |                 .selectAs(Solutions::getType,InsuranceApply::getSolutionType) | 
 |  |  |                 .selectAs(Company::getName,InsuranceApply::getCompanyName) | 
 |  |  |                 .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id and ad.END_TIME > now() ) as guaranteeNum") | 
 |  |  |                 .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) | 
 |  |  |                 .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) | 
 |  |  |                 .eq(InsuranceApply::getId,model.getId()) | 
 |  |  | 
 |  |  |                 .selectAs(DispatchUnit::getName,ApplyDetail::getDuName) | 
 |  |  |                 .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) | 
 |  |  |                 .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId) | 
 |  |  |                 .ge(ApplyDetail::getEndTime,DateUtil.getPlusTime2(new Date())) | 
 |  |  |                 .eq(ApplyDetail::getApplyId,model.getId()); | 
 |  |  |         //查询明细 | 
 |  |  |         List<ApplyDetail> detailList =applyDetailJoinMapper.selectJoinList(ApplyDetail.class,wrapper1); |