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.DeviceInformationMiaoqingMapper;
import com.fastbee.deviceInfo.domain.DeviceInformationMiaoqing;
import com.fastbee.deviceInfo.service.IDeviceInformationMiaoqingService;

/**
 * 苗情设备基础信息Service业务层处理
 * 
 * @author kerwincui
 * @date 2024-11-18
 */
@Service
public class DeviceInformationMiaoqingServiceImpl implements IDeviceInformationMiaoqingService 
{
    @Autowired
    private DeviceInformationMiaoqingMapper deviceInformationMiaoqingMapper;

    /**
     * 查询苗情设备基础信息
     *
     * @return 苗情设备基础信息
     */
    @Override
    public DeviceInformationMiaoqing selectDeviceInformationMiaoqingById(String device_encoding)
    {
        return deviceInformationMiaoqingMapper.selectDeviceInformationMiaoqingById(device_encoding);
    }

    /**
     * 查询苗情设备基础信息列表
     * 
     * @param deviceInformationMiaoqing 苗情设备基础信息
     * @return 苗情设备基础信息
     */
    @Override
    public List<DeviceInformationMiaoqing> selectDeviceInformationMiaoqingList(DeviceInformationMiaoqing deviceInformationMiaoqing)
    {
        return deviceInformationMiaoqingMapper.selectDeviceInformationMiaoqingList(deviceInformationMiaoqing);
    }

    /**
     * 新增苗情设备基础信息
     * 
     * @param deviceInformationMiaoqing 苗情设备基础信息
     * @return 结果
     */
    @Override
    public int insertDeviceInformationMiaoqing(DeviceInformationMiaoqing deviceInformationMiaoqing)
    {
        deviceInformationMiaoqing.setCreateTime(DateUtils.getNowDate());
        return deviceInformationMiaoqingMapper.insertDeviceInformationMiaoqing(deviceInformationMiaoqing);
    }

    /**
     * 修改苗情设备基础信息
     * 
     * @param deviceInformationMiaoqing 苗情设备基础信息
     * @return 结果
     */
    @Override
    public int updateDeviceInformationMiaoqing(DeviceInformationMiaoqing deviceInformationMiaoqing)
    {
        deviceInformationMiaoqing.setUpdateTime(DateUtils.getNowDate());
        return deviceInformationMiaoqingMapper.updateDeviceInformationMiaoqing(deviceInformationMiaoqing);
    }

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

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