package com.ruoyi.mall.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallBaseStationMapper;
import com.ruoyi.mall.domain.MallBaseStation;
import com.ruoyi.mall.service.IMallBaseStationService;

import javax.annotation.Resource;

/**
 * 基站Service业务层处理
 *
 * @author LCL
 * @date 2024-03-17
 */
@Service
public class MallBaseStationServiceImpl implements IMallBaseStationService
{
    @Resource
    private MallBaseStationMapper mallBaseStationMapper;

    /**
     * 查询基站
     *
     * @param baseStationId 基站主键
     * @return 基站
     */
    @Override
    public MallBaseStation selectMallBaseStationByBaseStationId(Long baseStationId)
    {
        return mallBaseStationMapper.selectMallBaseStationByBaseStationId(baseStationId);
    }

    /**
     * 查询基站列表
     *
     * @param mallBaseStation 基站
     * @return 基站
     */
    @Override
    public List<MallBaseStation> selectMallBaseStationList(MallBaseStation mallBaseStation)
    {
        return mallBaseStationMapper.selectMallBaseStationList(mallBaseStation);
    }

    /**
     * 新增基站
     *
     * @param mallBaseStation 基站
     * @return 结果
     */
    @Override
    public int insertMallBaseStation(MallBaseStation mallBaseStation)
    {
        mallBaseStation.setCreateAt(DateUtils.getTime());
        return mallBaseStationMapper.insertMallBaseStation(mallBaseStation);
    }

    /**
     * 修改基站
     *
     * @param mallBaseStation 基站
     * @return 结果
     */
    @Override
    public int updateMallBaseStation(MallBaseStation mallBaseStation)
    {
        mallBaseStation.setUpdateAt(DateUtils.getTime());
        return mallBaseStationMapper.updateMallBaseStation(mallBaseStation);
    }

    /**
     * 批量删除基站
     *
     * @param baseStationIds 需要删除的基站主键
     * @return 结果
     */
    @Override
    public int deleteMallBaseStationByBaseStationIds(Long[] baseStationIds)
    {
        return mallBaseStationMapper.deleteMallBaseStationByBaseStationIds(baseStationIds);
    }

    /**
     * 删除基站信息
     *
     * @param baseStationId 基站主键
     * @return 结果
     */
    @Override
    public int deleteMallBaseStationByBaseStationId(Long baseStationId)
    {
        return mallBaseStationMapper.deleteMallBaseStationByBaseStationId(baseStationId);
    }

    /**
     * APP查询基站列表
     *
     * @param params 参数
     * @return 基站集合
     */
    @Override
    public List<Map<String, Object>> selectAppMallBaseStationList(Map<String,Object> params) {
        return mallBaseStationMapper.selectAppMallBaseStationList(params);
    }

    /**
     * APP查询基站
     *
     * @param params 参数
     * @return 基站集合
     */
    @Override
    public Map<String, Object> selectAppMallBaseStation(Map<String, Object> params) {
        return mallBaseStationMapper.selectAppMallBaseStation(params);
    }
}
