package com.fastbee.rechargecard.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.rechargecard.mapper.NgIrrigationControllersMapper;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
import com.fastbee.rechargecard.service.INgIrrigationControllersService;

/**
 * 灌溉控制器信息Service业务层处理
 *
 * @author kerwincui
 * @date 2024-12-19
 */
@Service
public class NgIrrigationControllersServiceImpl implements INgIrrigationControllersService
{
    @Autowired
    private NgIrrigationControllersMapper ngIrrigationControllersMapper;

    /**
     * 查询灌溉控制器信息
     *
     * @param id 灌溉控制器信息主键
     * @return 灌溉控制器信息
     */
    @Override
    public NgIrrigationControllers selectNgIrrigationControllersById(Long id)
    {
        return ngIrrigationControllersMapper.selectNgIrrigationControllersById(id);
    }

    /**
     * 查询灌溉控制器信息列表
     *
     * @param ngIrrigationControllers 灌溉控制器信息
     * @return 灌溉控制器信息
     */
    @Override
    public List<NgIrrigationControllers> selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers)
    {
        return ngIrrigationControllersMapper.selectNgIrrigationControllersList(ngIrrigationControllers);
    }

    /**
     * 新增灌溉控制器信息
     *
     * @param ngIrrigationControllers 灌溉控制器信息
     * @return 结果
     */
    @Override
    public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers)
    {
        ngIrrigationControllers.setCreateTime(DateUtils.getNowDate());
        return ngIrrigationControllersMapper.insertNgIrrigationControllers(ngIrrigationControllers);
    }

    /**
     * 修改灌溉控制器信息
     *
     * @param ngIrrigationControllers 灌溉控制器信息
     * @return 结果
     */
    @Override
    public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers)
    {
        ngIrrigationControllers.setUpdateTime(DateUtils.getNowDate());
        return ngIrrigationControllersMapper.updateNgIrrigationControllers(ngIrrigationControllers);
    }

    /**
     * 批量删除灌溉控制器信息
     *
     * @param ids 需要删除的灌溉控制器信息主键
     * @return 结果
     */
    @Override
    public int deleteNgIrrigationControllersByIds(Long[] ids)
    {
        return ngIrrigationControllersMapper.deleteNgIrrigationControllersByIds(ids);
    }

    /**
     * 删除灌溉控制器信息信息
     *
     * @param id 灌溉控制器信息主键
     * @return 结果
     */
    @Override
    public int deleteNgIrrigationControllersById(Long id)
    {
        return ngIrrigationControllersMapper.deleteNgIrrigationControllersById(id);
    }
}
