| | |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | queryWrapper.select(" DATEDIFF( t.END_TIME ,now() ) AS loseEfficacyDays "); |
| | | queryWrapper.select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum"); |
| | | 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); |
| | | queryWrapper.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId); |
| | | queryWrapper.eq(InsuranceApply::getIsdeleted,Constants.ZERO); |
| | | //企业人员查看本企业数据 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | |
| | | if (pageWrap.getModel().getCreateTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE())); |
| | | } |
| | | |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.eq(Solutions::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getCode() != null) { |
| | | queryWrapper.eq(InsuranceApply::getCode, pageWrap.getModel().getCode()); |
| | | } |
| | |
| | | return pageData; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<InsuranceApply> findListByDTO(InsuranceApplyQueryDTO model) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | MPJLambdaWrapper<InsuranceApply> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(InsuranceApply.class); |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | 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); |
| | | queryWrapper.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId); |
| | | queryWrapper.eq(InsuranceApply::getIsdeleted,Constants.ZERO); |
| | | //企业人员查看本企业数据 |
| | | if(loginUserInfo.getType().equals(Constants.ONE)){ |
| | | queryWrapper.eq(InsuranceApply::getCompanyId, loginUserInfo.getCompanyId()); |
| | | } |
| | | if (model.getSolutionId() != null) { |
| | | queryWrapper.eq(InsuranceApply::getSolutionId, model.getSolutionId()); |
| | | } |
| | | if (model.getEndTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(model.getEndTimeS())); |
| | | } |
| | | if (model.getEndTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getEndTime, Utils.Date.getEnd(model.getEndTimeE())); |
| | | } |
| | | if (model.getStartTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getStartTime, Utils.Date.getStart(model.getStartTimeS())); |
| | | } |
| | | if (model.getStartTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getStartTime, Utils.Date.getEnd(model.getStartTimeE())); |
| | | } |
| | | if (model.getCreateTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getCreateDate, Utils.Date.getStart(model.getCreateTimeS())); |
| | | } |
| | | if (model.getCreateTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getCreateDate, Utils.Date.getEnd(model.getCreateTimeE())); |
| | | } |
| | | if (model.getType() != null) { |
| | | queryWrapper.eq(Solutions::getType, model.getType()); |
| | | } |
| | | if (model.getCode() != null) { |
| | | queryWrapper.eq(InsuranceApply::getCode, model.getCode()); |
| | | } |
| | | if (model.getStatus() != null) { |
| | | queryWrapper.eq(InsuranceApply::getStatus, model.getStatus()); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(model.getIds())) { |
| | | queryWrapper.in(InsuranceApply::getId, model.getIds()); |
| | | } |
| | | List<InsuranceApply> list = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class, queryWrapper); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getId,model.getId()) |
| | |
| | | |
| | | |
| | | |
| | | |
| | | } |