package com.xinda.iot.service.impl;

import java.util.List;
import com.xinda.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xinda.iot.mapper.CamDeviceMapper;
import com.xinda.iot.domain.CamDevice;
import com.xinda.iot.service.ICamDeviceService;

/**
 * 监控设备关联Service业务层处理
 * 
 * @author ledo
 * @date 2025-04-04
 */
@Service
public class CamDeviceServiceImpl implements ICamDeviceService
{
    @Autowired
    private CamDeviceMapper camDeviceMapper;

    /**
     * 查询监控设备关联
     * 
     * @param id 监控设备关联主键
     * @return 监控设备关联
     */
    @Override
    public CamDevice selectCamDeviceById(Long id)
    {
        return camDeviceMapper.selectCamDeviceById(id);
    }

    /**
     * 查询监控设备关联列表
     * 
     * @param camDevice 监控设备关联
     * @return 监控设备关联
     */
    @Override
    public List<CamDevice> selectCamDeviceList(CamDevice camDevice)
    {
        return camDeviceMapper.selectCamDeviceList(camDevice);
    }

    /**
     * 新增监控设备关联
     * 
     * @param camDevice 监控设备关联
     * @return 结果
     */
    @Override
    public int insertCamDevice(CamDevice camDevice)
    {
        camDevice.setCreateTime(DateUtils.getNowDate());
        return camDeviceMapper.insertCamDevice(camDevice);
    }

    /**
     * 修改监控设备关联
     * 
     * @param camDevice 监控设备关联
     * @return 结果
     */
    @Override
    public int updateCamDevice(CamDevice camDevice)
    {
        camDevice.setUpdateTime(DateUtils.getNowDate());
        return camDeviceMapper.updateCamDevice(camDevice);
    }

    /**
     * 批量删除监控设备关联
     * 
     * @param ids 需要删除的监控设备关联主键
     * @return 结果
     */
    @Override
    public int deleteCamDeviceByIds(Long[] ids)
    {
        return camDeviceMapper.deleteCamDeviceByIds(ids);
    }

    /**
     * 删除监控设备关联信息
     * 
     * @param id 监控设备关联主键
     * @return 结果
     */
    @Override
    public int deleteCamDeviceById(Long id)
    {
        return camDeviceMapper.deleteCamDeviceById(id);
    }
}
