| | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.function.Consumer; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | queryWrapper.in(TbCompany::getCompanyCategory, query.getCompanyCategorys()); |
| | | } |
| | | |
| | | if (query.getRegisteredCapitals() != null && query.getRegisteredCapitals().size() > 0) { |
| | | |
| | | queryWrapper.in(TbCompany::getRegisteredCapital, query.getRegisteredCapitals()); |
| | | } |
| | | |
| | | if (query.getCompanyIndustryIds() != null && query.getCompanyIndustryIds().size() > 0) { |
| | | queryWrapper.in(TbCompany::getCompanyIndustryId, query.getCompanyIndustryIds()); |
| | |
| | | if (query.getHaveSoftWorks() != null) { |
| | | queryWrapper.eq(TbCompany::getHaveSoftWorks, query.getHaveSoftWorks()); |
| | | } |
| | | if (query.getMoneySort() != null && query.getMoneySort() == 1) { |
| | | queryWrapper.orderByDesc(TbCompany::getSaleMoney); |
| | | } else if (query.getMoneySort() != null && query.getMoneySort() == 2) { |
| | | queryWrapper.orderByAsc(TbCompany::getSaleMoney); |
| | | } else { |
| | | queryWrapper.orderByDesc(TbCompany::getCreateTime); |
| | | String sql=""; |
| | | if (query.getRegisteredCapitals() != null && query.getRegisteredCapitals().size() > 0) { |
| | | List<String> registeredCapitals = query.getRegisteredCapitals(); |
| | | sql += " and ("; |
| | | boolean first = true; |
| | | for (String registeredCapital : registeredCapitals) { |
| | | if (!first) { |
| | | sql += " OR "; |
| | | } |
| | | switch (registeredCapital) { |
| | | case "10W以下": |
| | | sql += " (registered_capital between 0 and 10)"; |
| | | break; |
| | | case "10-50W以下": |
| | | sql += " (registered_capital between 10 and 50)"; |
| | | break; |
| | | case "50-100W以下": |
| | | sql += " (registered_capital between 50 and 100)"; |
| | | break; |
| | | case "100-500W以下": |
| | | sql += " (registered_capital between 100 and 501)"; |
| | | break; |
| | | case "500-1000W以下": |
| | | sql += " (registered_capital between 500 and 1000)"; |
| | | break; |
| | | case "1000W以上": |
| | | sql += " (registered_capital >= 1000)"; |
| | | break; |
| | | } |
| | | first = false; |
| | | } |
| | | sql += ")"; |
| | | } |
| | | |
| | | if (query.getMoneySort() != null && query.getMoneySort() == 1) { |
| | | sql += " ORDER BY sale_money DESC"; |
| | | } else if (query.getMoneySort() != null && query.getMoneySort() == 2) { |
| | | sql += " ORDER BY sale_money ASC"; |
| | | } else { |
| | | sql += " ORDER BY create_time DESC"; |
| | | } |
| | | queryWrapper.last(sql); |
| | | Page<TbCompany> companyPage = this.baseMapper.selectPage(page, queryWrapper); |
| | | if (companyPage.getRecords().isEmpty()) { |
| | | return page1; |
| | |
| | | map.put("completed", list.stream().filter(e -> e.getStatus() == 5).count() + list.stream().filter(e -> e.getStatus() == 6).count()); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public CompanyDetailVo companyDetail(String companyId, Long userId) { |
| | | CompanyDetailVo companyDetailVo = new CompanyDetailVo(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return companyDetailVo; |