| | |
| | | package com.ycl.service.depart.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.entity.depart.DepartManager; |
| | | import com.ycl.mapper.depart.DepartManagerMapper; |
| | | import com.ycl.service.depart.IDepartManagerService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhanghua |
| | |
| | | @Service |
| | | public class DepartManagerServiceImpl extends ServiceImpl<DepartManagerMapper, DepartManager> implements IDepartManagerService { |
| | | |
| | | @Override |
| | | public void deleteByDepartId(Long departId) { |
| | | LambdaQueryWrapper<DepartManager> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DepartManager::getDepartId, departId); |
| | | baseMapper.delete(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Collection<Long> getByDeptId(Long deptId) { |
| | | LambdaQueryWrapper<DepartManager> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DepartManager::getDepartId, deptId); |
| | | return baseMapper.selectList(queryWrapper).stream().map(DepartManager::getUserId).collect(Collectors.toSet()); |
| | | } |
| | | } |