TransferCompanyServiceImpl.java
2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.laowu.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.laowu.dto.assist.OneCompanyProjectsDTO;
import com.laowu.mapper.TransferCompanyMapper;
import com.laowu.mapper.TransferProjectMapper;
import com.laowu.mapper.TransferProjectMembersMapper;
import com.laowu.model.TransferCompanyDO;
import com.laowu.model.TransferProjectDO;
import com.laowu.service.TransferCompanyService;
import com.laowu.vo.assist.CompanyCntVO;
import com.laowu.vo.assist.CompanyProjectsVO;
import com.laowu.vo.assist.OneCompanyProjectsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author Tuyp
* @since 2023-09-11
*/
@Service
public class TransferCompanyServiceImpl extends ServiceImpl<TransferCompanyMapper, TransferCompanyDO> implements TransferCompanyService {
@Autowired
private TransferProjectMapper transferProjectMapper;
@Autowired
private TransferProjectMembersMapper transferProjectMembersMapper;
public CompanyCntVO companyCnt() {
CompanyCntVO companyCntVO = new CompanyCntVO();
Integer count = this.baseMapper.selectCount(null);
companyCntVO.setCompanyCnt(count);
Integer memberCnt = transferProjectMembersMapper.selectCount(null);
companyCntVO.setMemberCnt(memberCnt);
return companyCntVO;
}
public List<CompanyProjectsVO> companyProjects() {
List<CompanyProjectsVO> companyProjectsVOS = this.baseMapper.companyProjects();
companyProjectsVOS.stream().forEach(x -> {
//项目数
Integer count = transferProjectMapper.selectCount(new QueryWrapper<TransferProjectDO>()
.lambda()
.eq(TransferProjectDO::getCompanyId, x.getId()));
x.setProjectCnt(count);
});
return companyProjectsVOS;
}
public List<OneCompanyProjectsVO> oneCompanyProjects(OneCompanyProjectsDTO oneCompanyProjectsDTO) {
return this.baseMapper.oneCompanyProjects(oneCompanyProjectsDTO.getCompanyId(),oneCompanyProjectsDTO.getYear());
}
}