package com.platform.yijia.service.impl;

import com.platform.yijia.dao.StationOilGunMapper;
import com.platform.yijia.pojo.StationOilGun;
import com.platform.yijia.pojo.StationOilGunExample;
import com.platform.yijia.service.StationOilGunService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("stationOilGunService")
public class StationOilGunServiceImpl implements StationOilGunService {
    @Resource
    private StationOilGunMapper stationOilGunMapper;

    //根据加油员获取油枪列表信息
    @Override
    public List<Map<String, Object>> selectOilGunByPersonalId(Map<String, Object> params) {
        return stationOilGunMapper.selectOilGunByPersonalId(params);
    }

    //根据油站Id油枪号获取打印机编号
    @Override
    public List<Map<String, Object>> getPrinterSnByStationIdAndOilGunNoList(Map<String, Object> params) {
        return stationOilGunMapper.getPrinterSnByStationIdAndOilGunNoList(params);
    }

    @Override
    public List<StationOilGun> stationOilGunList(StationOilGun stationOilGun) {
        StationOilGunExample example = new StationOilGunExample();
        example.or().andStationIdEqualTo(stationOilGun.getStationId());
        List<StationOilGun> stationInfolist = stationOilGunMapper.selectByExample(example);
        return stationInfolist;

    }

    /*
     * 根据油站Id油枪号获取打印机编号
     * @param params
     * @return
     */
    @Override
    public Map<String, Object> getPrinterSnByStationIdAndOilGunNo(Map<String, Object> params) {
        return stationOilGunMapper.getPrinterSnByStationIdAndOilGunNo(params);
    }
}
