package com.willalp.device.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.willalp.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.willalp.device.mapper.NetworkConfigMapper;
import com.willalp.device.domain.NetworkConfig;
import com.willalp.device.service.INetworkConfigService;

/**
 * 网络配置 Service业务层处理
 *
 * @author willalp
 * @date 2021-11-23
 */
@Service
public class NetworkConfigServiceImpl extends ServiceImpl<NetworkConfigMapper, NetworkConfig>  implements INetworkConfigService
{
    @Autowired
    private NetworkConfigMapper networkConfigMapper;

    /**
     * 查询网络配置
     *
     * @param networkConfigId 网络配置 主键
     * @return 网络配置
     */
    @Override
    public NetworkConfig selectNetworkConfigByNetworkConfigId(String networkConfigId)
    {
        return networkConfigMapper.selectNetworkConfigByNetworkConfigId(networkConfigId);
    }

    /**
     * 查询网络配置 列表
     *
     * @param networkConfig 网络配置
     * @return 网络配置
     */
    @Override
    public List<NetworkConfig> selectNetworkConfigList(NetworkConfig networkConfig)
    {
        return networkConfigMapper.selectNetworkConfigList(networkConfig);
    }

    /**
     * 新增网络配置
     *
     * @param networkConfig 网络配置
     * @return 结果
     */
    @Override
    public int insertNetworkConfig(NetworkConfig networkConfig)
    {
        networkConfig.setCreateTime(DateUtils.getNowDate());
        return networkConfigMapper.insertNetworkConfig(networkConfig);
    }

    /**
     * 修改网络配置
     *
     * @param networkConfig 网络配置
     * @return 结果
     */
    @Override
    public int updateNetworkConfig(NetworkConfig networkConfig)
    {
        networkConfig.setUpdateTime(DateUtils.getNowDate());
        return networkConfigMapper.updateNetworkConfig(networkConfig);
    }

    /**
     * 批量删除网络配置
     *
     * @param networkConfigIds 需要删除的网络配置 主键
     * @return 结果
     */
    @Override
    public int deleteNetworkConfigByNetworkConfigIds(String[] networkConfigIds)
    {
        return networkConfigMapper.deleteNetworkConfigByNetworkConfigIds(networkConfigIds);
    }

    /**
     * 删除网络配置 信息
     *
     * @param networkConfigId 网络配置 主键
     * @return 结果
     */
    @Override
    public int deleteNetworkConfigByNetworkConfigId(String networkConfigId)
    {
        return networkConfigMapper.deleteNetworkConfigByNetworkConfigId(networkConfigId);
    }
}
