package com.ruoyi.project.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysIpMapper;
import com.ruoyi.project.system.domain.SysIp;
import com.ruoyi.project.system.service.ISysIpService;

/**
 * 授权登录IPService业务层处理
 *
 * @author ruoyi
 * @date 2023-10-16
 */
@Service
public class SysIpServiceImpl implements ISysIpService {
    @Autowired
    private SysIpMapper sysIpMapper;

    /**
     * 查询授权登录IP
     *
     * @param id 授权登录IP主键
     * @return 授权登录IP
     */
    @Override
    public SysIp selectSysIpById(Long id) {
        return sysIpMapper.selectSysIpById(id);
    }

    /**
     * 查询授权登录IP列表
     *
     * @param sysIp 授权登录IP
     * @return 授权登录IP
     */
    @Override
    public List<SysIp> selectSysIpList(SysIp sysIp) {
        return sysIpMapper.selectSysIpList(sysIp);
    }

    /**
     * 新增授权登录IP
     *
     * @param sysIp 授权登录IP
     * @return 结果
     */
    @Override
    public int insertSysIp(SysIp sysIp) {
        return sysIpMapper.insertSysIp(sysIp);
    }

    /**
     * 修改授权登录IP
     *
     * @param sysIp 授权登录IP
     * @return 结果
     */
    @Override
    public int updateSysIp(SysIp sysIp) {
        sysIp.setUpdateTime(DateUtils.getNowDate());
        return sysIpMapper.updateSysIp(sysIp);
    }

    /**
     * 批量删除授权登录IP
     *
     * @param ids 需要删除的授权登录IP主键
     * @return 结果
     */
    @Override
    public int deleteSysIpByIds(Long[] ids) {
        return sysIpMapper.deleteSysIpByIds(ids);
    }

    /**
     * 删除授权登录IP信息
     *
     * @param id 授权登录IP主键
     * @return 结果
     */
    @Override
    public int deleteSysIpById(Long id) {
        return sysIpMapper.deleteSysIpById(id);
    }
}
