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.SensorConfigMapper;
import com.zd.laboratory.domain.SensorConfig;
import com.zd.laboratory.service.ISensorConfigService;

/**
 * 传感器解析配置Service业务层处理
 * 
 * @author zd
 * @date 2021-10-27
 */
@Service
public class SensorConfigServiceImpl implements ISensorConfigService 
{
    @Autowired
    private SensorConfigMapper sensorConfigMapper;

    /**
     * 查询传感器解析配置
     * 
     * @param id 传感器解析配置主键
     * @return 传感器解析配置
     */
    @Override
    public SensorConfig selectSensorConfigById(Long id)
    {
        return sensorConfigMapper.selectSensorConfigById(id);
    }

    /**
     * 查询传感器解析配置列表
     * 
     * @param sensorConfig 传感器解析配置
     * @return 传感器解析配置
     */
    @Override
    public List<SensorConfig> selectSensorConfigList(SensorConfig sensorConfig)
    {
        return sensorConfigMapper.selectSensorConfigList(sensorConfig);
    }

    /**
     * 新增传感器解析配置
     * 
     * @param sensorConfig 传感器解析配置
     * @return 结果
     */
    @Override
    public int insertSensorConfig(SensorConfig sensorConfig)
    {
        //设置其他公共字段
        SaveUtil.setCommonAttr(sensorConfig);
        return sensorConfigMapper.insertSensorConfig(sensorConfig);
    }

    /**
     * 修改传感器解析配置
     * 
     * @param sensorConfig 传感器解析配置
     * @return 结果
     */
    @Override
    public int updateSensorConfig(SensorConfig sensorConfig)
    {
        return sensorConfigMapper.updateSensorConfig(sensorConfig);
    }

    /**
     * 批量删除传感器解析配置
     * 
     * @param ids 需要删除的传感器解析配置主键
     * @return 结果
     */
    @Override
    public int deleteSensorConfigByIds(Long[] ids)
    {
        return sensorConfigMapper.deleteSensorConfigByIds(ids);
    }

    /**
     * 删除传感器解析配置信息
     * 
     * @param id 传感器解析配置主键
     * @return 结果
     */
    @Override
    public int deleteSensorConfigById(Long id)
    {
        return sensorConfigMapper.deleteSensorConfigById(id);
    }
}
