| | |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.mapper.CameraMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取更新监控数量 |
| | | * @param deptId |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | public int getUpdateCount(String deptId, Date start, Date end) { |
| | | |
| | | QueryWrapper<Camera> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if(StringUtils.isNotBlank(deptId)){ |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | if (null != start) { |
| | | queryWrapper.ge("update_time", start); |
| | | } |
| | | if (null != end) { |
| | | queryWrapper.le("update_time", end); |
| | | } |
| | | |
| | | return cameraMapper.selectCount(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 保存数据 |
| | | * @param data |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 远程拉取监控信息后更新 |
| | | * @param data |
| | | */ |
| | | public void pullUpdateCamera(Camera data) { |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | int i = cameraMapper.updateById(data); |
| | | if(i == 0){ |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | cameraMapper.insert(data); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * @param data |
| | | * @return |