package com.yijia.station.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yijia.station.mapper.StationOilPriceMapper;
import com.yijia.station.domain.StationOilPrice;
import com.yijia.station.service.IStationOilPriceService;

/**
 * 油品价格Service业务层处理
 *
 * @author yijia
 * @date 2020-12-08
 */
@Service
public class StationOilPriceServiceImpl implements IStationOilPriceService
{
    @Autowired
    private StationOilPriceMapper stationOilPriceMapper;

    /**
     * 查询油品价格
     *
     * @param oilPriceId 油品价格ID
     * @return 油品价格
     */
    @Override
    public StationOilPrice selectStationOilPriceById(Long oilPriceId)
    {
        return stationOilPriceMapper.selectStationOilPriceById(oilPriceId);
    }

    /**
     * 查询油品价格列表
     *
     * @param stationOilPrice 油品价格
     * @return 油品价格
     */
    @Override
    public List<StationOilPrice> selectStationOilPriceList(StationOilPrice stationOilPrice)
    {
        return stationOilPriceMapper.selectStationOilPriceList(stationOilPrice);
    }

    /**
     * 新增油品价格
     *
     * @param stationOilPrice 油品价格
     * @return 结果
     */
    @Override
    public int insertStationOilPrice(StationOilPrice stationOilPrice)
    {
        return stationOilPriceMapper.insertStationOilPrice(stationOilPrice);
    }

    /**
     * 修改油品价格
     *
     * @param stationOilPrice 油品价格
     * @return 结果
     */
    @Override
    public int updateStationOilPrice(StationOilPrice stationOilPrice)
    {
        return stationOilPriceMapper.updateStationOilPrice(stationOilPrice);
    }

    /**
     * 批量删除油品价格
     *
     * @param oilPriceIds 需要删除的油品价格ID
     * @return 结果
     */
    @Override
    public int deleteStationOilPriceByIds(Long[] oilPriceIds)
    {
        return stationOilPriceMapper.deleteStationOilPriceByIds(oilPriceIds);
    }

    /**
     * 删除油品价格信息
     *
     * @param oilPriceId 油品价格ID
     * @return 结果
     */
    @Override
    public int deleteStationOilPriceById(Long oilPriceId)
    {
        return stationOilPriceMapper.deleteStationOilPriceById(oilPriceId);
    }

    /**
     * 查询当前油站对应的油品名称(不包括非油品)
     */
    @Override
    public List<StationOilPrice> oilNameInfo(StationOilPrice stationOilPrice) {
        return stationOilPriceMapper.oilNameInfo(stationOilPrice);
    }

    /**
     * 查询站中的油品价格和油品类型
     */
    @Override
    public List<StationOilPrice> selectOilPriceList(StationOilPrice stationOilPrice) {
        return stationOilPriceMapper.selectOilPriceList(stationOilPrice) ;
    }
}
