package com.zd.laboratory.service.impl;

import java.util.List;
import com.zd.common.core.utils.DateUtils;
import com.zd.common.security.utils.SaveUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zd.laboratory.mapper.LabRelayMapper;
import com.zd.laboratory.domain.LabRelay;
import com.zd.laboratory.service.ILabRelayService;

/**
 * 继电器和传感器网关Service业务层处理
 * 
 * @author zd
 * @date 2021-10-16
 */
@Service
public class LabRelayServiceImpl implements ILabRelayService 
{
    @Autowired
    private LabRelayMapper labRelayMapper;

    /**
     * 查询继电器和传感器网关
     * 
     * @param id 继电器和传感器网关主键
     * @return 继电器和传感器网关
     */
    @Override
    public LabRelay selectLabRelayById(Long id)
    {
        return labRelayMapper.selectLabRelayById(id);
    }

    /**
     * 查询继电器和传感器网关列表
     * 
     * @param labRelay 继电器和传感器网关
     * @return 继电器和传感器网关
     */
    @Override
    public List<LabRelay> selectLabRelayList(LabRelay labRelay)
    {
        return labRelayMapper.selectLabRelayList(labRelay);
    }

    /**
     * 新增继电器和传感器网关
     * 
     * @param labRelay 继电器和传感器网关
     * @return 结果
     */
    @Override
    public int insertLabRelay(LabRelay labRelay)
    {
        //设置其他公共字段
        SaveUtil.setCommonAttr(labRelay);
        return labRelayMapper.insertLabRelay(labRelay);
    }

    /**
     * 修改继电器和传感器网关
     * 
     * @param labRelay 继电器和传感器网关
     * @return 结果
     */
    @Override
    public int updateLabRelay(LabRelay labRelay)
    {
        return labRelayMapper.updateLabRelay(labRelay);
    }

    /**
     * 批量删除继电器和传感器网关
     * 
     * @param ids 需要删除的继电器和传感器网关主键
     * @return 结果
     */
    @Override
    public int deleteLabRelayByIds(Long[] ids)
    {
        return labRelayMapper.deleteLabRelayByIds(ids);
    }

    /**
     * 删除继电器和传感器网关信息
     * 
     * @param id 继电器和传感器网关主键
     * @return 结果
     */
    @Override
    public int deleteLabRelayById(Long id)
    {
        return labRelayMapper.deleteLabRelayById(id);
    }
}
