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.DeviceInformationWormsMapper;
import com.fastbee.deviceInfo.domain.DeviceInformationWorms;
import com.fastbee.deviceInfo.service.IDeviceInformationWormsService;

/**
 * 虫情设备基础信息Service业务层处理
 * 
 * @author kerwincui
 * @date 2024-11-18
 */
@Service
public class DeviceInformationWormsServiceImpl implements IDeviceInformationWormsService 
{
    @Autowired
    private DeviceInformationWormsMapper deviceInformationWormsMapper;

    /**
     * 查询虫情设备基础信息
     * 
     * @param id 虫情设备基础信息主键
     * @return 虫情设备基础信息
     */
    @Override
    public DeviceInformationWorms selectDeviceInformationWormsById(String deviceEncoding)
    {
        return deviceInformationWormsMapper.selectDeviceInformationWormsById(deviceEncoding);
    }

    /**
     * 查询虫情设备基础信息列表
     * 
     * @param deviceInformationWorms 虫情设备基础信息
     * @return 虫情设备基础信息
     */
    @Override
    public List<DeviceInformationWorms> selectDeviceInformationWormsList(DeviceInformationWorms deviceInformationWorms)
    {
        return deviceInformationWormsMapper.selectDeviceInformationWormsList(deviceInformationWorms);
    }

    /**
     * 新增虫情设备基础信息
     * 
     * @param deviceInformationWorms 虫情设备基础信息
     * @return 结果
     */
    @Override
    public int insertDeviceInformationWorms(DeviceInformationWorms deviceInformationWorms)
    {
        deviceInformationWorms.setCreateTime(DateUtils.getNowDate());
        return deviceInformationWormsMapper.insertDeviceInformationWorms(deviceInformationWorms);
    }

    /**
     * 修改虫情设备基础信息
     * 
     * @param deviceInformationWorms 虫情设备基础信息
     * @return 结果
     */
    @Override
    public int updateDeviceInformationWorms(DeviceInformationWorms deviceInformationWorms)
    {
        deviceInformationWorms.setUpdateTime(DateUtils.getNowDate());
        return deviceInformationWormsMapper.updateDeviceInformationWorms(deviceInformationWorms);
    }

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

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