| | |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | queryWrapper.selectAs(Solutions::getType,InsuranceApply::getSolutionType); |
| | | queryWrapper.selectAs(Solutions::getMaxAge,InsuranceApply::getMaxAge); |
| | | queryWrapper.selectAs(Solutions::getMinAge,InsuranceApply::getMinAge); |
| | | queryWrapper.selectAs(Solutions::getPrice,InsuranceApply::getPrice); |
| | |
| | | //企业人员查看本企业数据 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | queryWrapper.eq(InsuranceApply::getCompanyId, loginUserInfo.getCompanyId()); |
| | | }else if(loginUserInfo.getType().equals(Constants.TWO)){ |
| | | //如果是商户查看 |
| | | if(pageWrap.getModel().getSolutionType()!=null && pageWrap.getModel().getSolutionType() ==0){ |
| | | queryWrapper.exists("select cs.id from company_solution cs where cs.isdeleted=0 and cs.company_id=t.company_id and cs.shop_id="+loginUserInfo.getCompanyId()); |
| | | }else if(pageWrap.getModel().getSolutionType()!=null && pageWrap.getModel().getSolutionType() ==1){ |
| | | queryWrapper.eq(Solutions::getShopId,loginUserInfo.getCompanyId()); |
| | | }else{ |
| | | queryWrapper.apply("((t1.type=0 and exists(select cs.id from company_solution cs where cs.isdeleted=0 and cs.company_id=t.company_id and cs.shop_id="+loginUserInfo.getCompanyId()+")) or (" + |
| | | "t1.type=1 and t1.shop_id="+loginUserInfo.getCompanyId()+"))") ; |
| | | } |
| | | }else{ |
| | | if(loginUserInfo.getCompanyIdList()!=null && loginUserInfo.getCompanyIdList().size()>0){ |
| | | queryWrapper.in(InsuranceApply::getCompanyId, loginUserInfo.getCompanyIdList()); |
| | |
| | | } |
| | | if (pageWrap.getModel().getSolutionId() != null) { |
| | | queryWrapper.eq(InsuranceApply::getSolutionId, pageWrap.getModel().getSolutionId()); |
| | | } |
| | | if (pageWrap.getModel().getSolutionType() != null) { |
| | | queryWrapper.eq(Solutions::getType, pageWrap.getModel().getSolutionType()); |
| | | } |
| | | if (pageWrap.getModel().getEndTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTimeS())); |
| | |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | queryWrapper.selectAs(Solutions::getType,InsuranceApply::getSolutionType); |
| | | queryWrapper.select(" ( select sum(td.fee) from taxes ts inner join tax_detial td on ts.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ) as taxesMoney "); |
| | | queryWrapper.select(" ( select td.CREATE_DATE from taxes ts inner join tax_detial td on ts.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id order by td.CREATE_DATE desc limit 1 ) as taxesLast "); |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId); |
| | |
| | | } |
| | | if (model.getSolutionId() != null) { |
| | | queryWrapper.eq(InsuranceApply::getSolutionId, model.getSolutionId()); |
| | | } |
| | | if (model.getSolutionType() != null) { |
| | | queryWrapper.eq(Solutions::getType,model.getSolutionType() ); |
| | | } |
| | | if (model.getEndTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(model.getEndTimeS())); |
| | |
| | | .selectAs(Solutions::getMinAge,InsuranceApply::getMinAge) |
| | | .selectAs(Solutions::getPrice,InsuranceApply::getPrice) |
| | | .selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit) |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .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") |
| | |
| | | |
| | | private void initImgData(InsuranceApply model) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,model.getId()) |
| | | .eq(Multifile::getObjId,Constants.equalsInteger(model.getSolutionType(),Constants.ZERO)? model.getId():model.getUnionApplyId()) |
| | | .in(Multifile::getObjType,Arrays.asList(new Integer[]{Constants.MultiFile.BD_APPLY_PDF.getKey() |
| | | ,Constants.MultiFile.BD_SIGNED_PDF.getKey() |
| | | ,Constants.MultiFile.BD_DONE_PDF.getKey()})) |