|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.manage_jp.entity.Camera;
|
|
|
import com.fdkankan.manage_jp.entity.CameraDetail;
|
|
|
+import com.fdkankan.manage_jp.entity.Company;
|
|
|
import com.fdkankan.manage_jp.entity.User;
|
|
|
import com.fdkankan.manage_jp.mapper.ICameraDetailMapper;
|
|
|
import com.fdkankan.manage_jp.mapper.ICameraMapper;
|
|
@@ -22,6 +23,7 @@ import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -39,6 +41,8 @@ public class CameraDetailServiceImpl extends MPJBaseServiceImpl<ICameraDetailMap
|
|
|
ICameraService cameraService;
|
|
|
@Autowired
|
|
|
IUserService userService;
|
|
|
+ @Autowired
|
|
|
+ ICompanyService companyService;
|
|
|
|
|
|
@Override
|
|
|
public void updateCompanyId(Long id) {
|
|
@@ -129,4 +133,16 @@ public class CameraDetailServiceImpl extends MPJBaseServiceImpl<ICameraDetailMap
|
|
|
Camera camera = byChildNames.get(0);
|
|
|
return this.getByCameraId(camera.getId());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<CameraDetail> getListByCompanyName(String companyName) {
|
|
|
+ List<Company> companyList = companyService.getLikeCompanyName(companyName);
|
|
|
+ Set<Long> companyIds = companyList.stream().map(Company::getId).collect(Collectors.toSet());
|
|
|
+ if(companyIds.size() <= 0){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<CameraDetail> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.in(CameraDetail::getCompanyId,companyIds);
|
|
|
+ return this.list(wrapper);
|
|
|
+ }
|
|
|
}
|