package com.jiayue.insu.inclientqn.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiayue.insu.inclientqn.entity.Station;
import com.jiayue.insu.inclientqn.mapper.StationMapper;
import com.jiayue.insu.inclientqn.service.StationService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 场站信息业务实现
 *
 * @author yh
 * @version 1.0
 * @since 2022/5/22 11:29
 */
@Service
public class StationServiceImpl extends ServiceImpl<StationMapper, Station> implements StationService {


    @Override
    public Station findThis() {
        return this.list().get(0);
    }

    @Override
    public Station findByStationCode(String stationCode) {
        LambdaQueryWrapper<Station> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(Station::getStationCode,stationCode);
        return this.getOne(lambdaQueryWrapper);
    }

    @Override
    public List<Station> findAll() {
        LambdaQueryWrapper<Station> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        return this.list(lambdaQueryWrapper);
    }
}
