|
@@ -1,6 +1,11 @@
|
|
|
package com.huimv.management.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.huimv.management.dao.CameraInfoDao;
|
|
|
+import com.huimv.management.entity.CameraInfoEntity;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import java.util.Map;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -23,6 +28,9 @@ import com.huimv.management.service.CameraBrandService;
|
|
|
@Service("cameraBrandService")
|
|
|
public class CameraBrandServiceImpl extends ServiceImpl<CameraBrandDao, CameraBrandEntity> implements CameraBrandService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CameraInfoDao cameraInfoDao;
|
|
|
+
|
|
|
@Override
|
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
|
QueryWrapper<CameraBrandEntity> wrapper = new QueryWrapper<>();
|
|
@@ -39,4 +47,17 @@ public class CameraBrandServiceImpl extends ServiceImpl<CameraBrandDao, CameraBr
|
|
|
return new PageUtils(page);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean delete(Integer[] ids) {
|
|
|
+ LambdaQueryWrapper<CameraInfoEntity> wrapper = Wrappers.lambdaQuery();
|
|
|
+ for (Integer id : ids) {
|
|
|
+ wrapper.eq(CameraInfoEntity::getCameraBrandId,id);
|
|
|
+ if ( cameraInfoDao.selectCount(wrapper) > 0){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ wrapper.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|