package com.fastbee.deviceInfo.service.impl;

import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.deviceInfo.mapper.DeviceInformationMoistureMapper;
import com.fastbee.deviceInfo.domain.DeviceInformationMoisture;
import com.fastbee.deviceInfo.service.IDeviceInformationMoistureService;

/**
 * 墒情设备基础信息Service业务层处理
 * 
 * @author kerwincui
 * @date 2024-11-18
 */
@Service
public class DeviceInformationMoistureServiceImpl implements IDeviceInformationMoistureService 
{
    @Autowired
    private DeviceInformationMoistureMapper deviceInformationMoistureMapper;

    /**
     * 根据deviceEncoding查询墒情设备基础信息
     * 
     * @param id 墒情设备基础信息主键
     * @return 墒情设备基础信息
     */
    @Override
    public DeviceInformationMoisture selectDeviceInformationMoistureById(String device_encoding)
    {
        return deviceInformationMoistureMapper.selectDeviceInformationMoistureById(device_encoding);
    }

    /**
     * 查询墒情设备基础信息列表
     * 
     * @param deviceInformationMoisture 墒情设备基础信息
     * @return 墒情设备基础信息
     */
    @Override
    public List<DeviceInformationMoisture> selectDeviceInformationMoistureList(DeviceInformationMoisture deviceInformationMoisture)
    {
        return deviceInformationMoistureMapper.selectDeviceInformationMoistureList(deviceInformationMoisture);
    }

    /**
     * 新增墒情设备基础信息
     * 
     * @param deviceInformationMoisture 墒情设备基础信息
     * @return 结果
     */
    @Override
    public int insertDeviceInformationMoisture(DeviceInformationMoisture deviceInformationMoisture)
    {
        deviceInformationMoisture.setCreateTime(DateUtils.getNowDate());
        return deviceInformationMoistureMapper.insertDeviceInformationMoisture(deviceInformationMoisture);
    }

    /**
     * 修改墒情设备基础信息
     * 
     * @param deviceInformationMoisture 墒情设备基础信息
     * @return 结果
     */
    @Override
    public int updateDeviceInformationMoisture(DeviceInformationMoisture deviceInformationMoisture)
    {
        deviceInformationMoisture.setUpdateTime(DateUtils.getNowDate());
        return deviceInformationMoistureMapper.updateDeviceInformationMoisture(deviceInformationMoisture);
    }

    /**
     * 批量删除墒情设备基础信息
     * 
     * @param ids 需要删除的墒情设备基础信息主键
     * @return 结果
     */
    @Override
    public int deleteDeviceInformationMoistureByIds(Long[] ids)
    {
        return deviceInformationMoistureMapper.deleteDeviceInformationMoistureByIds(ids);
    }

    /**
     * 删除墒情设备基础信息信息
     * 
     * @param id 墒情设备基础信息主键
     * @return 结果
     */
    @Override
    public int deleteDeviceInformationMoistureById(Long id)
    {
        return deviceInformationMoistureMapper.deleteDeviceInformationMoistureById(id);
    }
}
