From 47a53d22a025c0ed095c9c4ed2e1ce35ce54184e Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 30 十月 2024 14:16:16 +0800
Subject: [PATCH] 代码初始化

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java |  107 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 105 insertions(+), 2 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
index a79a985..ea21e28 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -355,8 +355,111 @@
 
     @Override
     public List<Company> findList(Company company) {
-        QueryWrapper<Company> wrapper = new QueryWrapper<>(company);
-        return companyMapper.selectList(wrapper);
+        MPJLambdaWrapper<Company> queryWrapper = new MPJLambdaWrapper<>();
+        company.setIsdeleted(Constants.ZERO);
+        if (company.getId() != null) {
+            queryWrapper.eq(Company::getId, company.getId());
+        }
+        if (company.getCreator() != null) {
+            queryWrapper.eq(Company::getCreator, company.getCreator());
+        }
+        if (company.getCreateDate() != null) {
+            queryWrapper.ge(Company::getCreateDate, Utils.Date.getStart(company.getCreateDate()));
+            queryWrapper.le(Company::getCreateDate, Utils.Date.getEnd(company.getCreateDate()));
+        }
+        if (company.getEditor() != null) {
+            queryWrapper.eq(Company::getEditor, company.getEditor());
+        }
+        if (company.getEditDate() != null) {
+            queryWrapper.ge(Company::getEditDate, Utils.Date.getStart(company.getEditDate()));
+            queryWrapper.le(Company::getEditDate, Utils.Date.getEnd(company.getEditDate()));
+        }
+        if (company.getIsdeleted() != null) {
+            queryWrapper.eq(Company::getIsdeleted, company.getIsdeleted());
+        }
+        if (company.getName() != null) {
+            queryWrapper.like(Company::getName, company.getName());
+        }
+        if (company.getRemark() != null) {
+            queryWrapper.eq(Company::getRemark, company.getRemark());
+        }
+        if (company.getStatus() != null) {
+            queryWrapper.eq(Company::getStatus, company.getStatus());
+        }
+        if (company.getSortnum() != null) {
+            queryWrapper.eq(Company::getSortnum, company.getSortnum());
+        }
+        if (company.getImgurl() != null) {
+            queryWrapper.eq(Company::getImgurl, company.getImgurl());
+        }
+        if (company.getType() != null) {
+            queryWrapper.eq(Company::getType, company.getType());
+        }
+        if (company.getCategoryId() != null) {
+            queryWrapper.eq(Company::getCategoryId, company.getCategoryId());
+        }
+        if (company.getCode() != null) {
+            queryWrapper.eq(Company::getCode, company.getCode());
+        }
+        if (company.getParentId() != null) {
+            queryWrapper.eq(Company::getParentId, company.getParentId());
+        }
+        if (company.getLinkName() != null) {
+            queryWrapper.eq(Company::getLinkName, company.getLinkName());
+        }
+        if (company.getLinkPhone() != null) {
+            queryWrapper.eq(Company::getLinkPhone, company.getLinkPhone());
+        }
+        if (company.getHkId() != null) {
+            queryWrapper.eq(Company::getHkId, company.getHkId());
+        }
+        if (company.getHkStatus() != null) {
+            queryWrapper.eq(Company::getHkStatus, company.getHkStatus());
+        }
+        if (company.getHkDate() != null) {
+            queryWrapper.ge(Company::getHkDate, Utils.Date.getStart(company.getHkDate()));
+            queryWrapper.le(Company::getHkDate, Utils.Date.getEnd(company.getHkDate()));
+        }
+        if (company.getErpId() != null) {
+            queryWrapper.eq(Company::getErpId, company.getErpId());
+        }
+        if (company.getErpDate() != null) {
+            queryWrapper.ge(Company::getErpDate, Utils.Date.getStart(company.getErpDate()));
+            queryWrapper.le(Company::getErpDate, Utils.Date.getEnd(company.getErpDate()));
+        }
+        if (company.getErpStatus() != null) {
+            queryWrapper.eq(Company::getErpStatus, company.getErpStatus());
+        }
+        if (company.getDdId() != null) {
+            queryWrapper.eq(Company::getDdId, company.getDdId());
+        }
+        if (company.getDdDate() != null) {
+            queryWrapper.ge(Company::getDdDate, Utils.Date.getStart(company.getDdDate()));
+            queryWrapper.le(Company::getDdDate, Utils.Date.getEnd(company.getDdDate()));
+        }
+        if (company.getDdStatus() != null) {
+            queryWrapper.eq(Company::getDdStatus, company.getDdStatus());
+        }
+        if (company.getFsId() != null) {
+            queryWrapper.eq(Company::getFsId, company.getFsId());
+        }
+        if (company.getFsStatus() != null) {
+            queryWrapper.eq(Company::getFsStatus, company.getFsStatus());
+        }
+        if (company.getFsDate() != null) {
+            queryWrapper.ge(Company::getFsDate, Utils.Date.getStart(company.getFsDate()));
+            queryWrapper.le(Company::getFsDate, Utils.Date.getEnd(company.getFsDate()));
+        }
+        queryWrapper.orderByDesc(Company::getCreateDate);
+        queryWrapper.leftJoin(Company.class,Company::getId,Company::getParentId);
+        queryWrapper.select(" t.* ")
+                .select("(select count(m.id) from member m where m.COMPANY_ID=t.id and m.ISDELETED=0) as countNum") ;
+        queryWrapper.select("t1.name",Company::getParentName);
+        queryWrapper.select("t1.company_path",Company::getParentCompanyPath);
+        queryWrapper.eq(Objects.nonNull(company.getStatus()),Company::getStatus,Constants.ZERO);
+        queryWrapper.like(StringUtils.isNotBlank(company.getName()),Company::getName,company.getName());
+        queryWrapper.like(StringUtils.isNotBlank(company.getParentName()),"c.name",company.getParentName());
+        return companyMapper.selectList(queryWrapper);
     }
 
     @Override

--
Gitblit v1.9.3