package com.inspect.metadata.station.service.impl;

import com.inspect.metadata.station.domain.BasedataStation;
import com.inspect.metadata.station.mapper.BasedataStationMapper;
import com.inspect.metadata.station.service.IBasedataStationService;
import com.inspect.base.core.utils.DateUtils;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BasedataStationServiceImpl implements IBasedataStationService {
    @Resource
    private BasedataStationMapper basedataStationMapper;

    public BasedataStation selectBasedataStationByStationId(String stationId) {
        return this.basedataStationMapper.selectBasedataStationByStationId(stationId);
    }

    public List<BasedataStation> selectBasedataStationList(BasedataStation basedataStation) {
        return this.basedataStationMapper.selectBasedataStationList(basedataStation);
    }

    public int insertBasedataStation(BasedataStation basedataStation) {
        basedataStation.setCreateTime(DateUtils.getNowDate());
        return this.basedataStationMapper.insertBasedataStation(basedataStation);
    }

    public int updateBasedataStation(BasedataStation basedataStation) {
        basedataStation.setUpdateTime(DateUtils.getNowDate());
        return this.basedataStationMapper.updateBasedataStation(basedataStation);
    }

    public int deleteBasedataStationByStationIds(String[] stationIds) {
        return this.basedataStationMapper.deleteBasedataStationByStationIds(stationIds);
    }

    public int deleteBasedataStationByStationId(String stationId) {
        return this.basedataStationMapper.deleteBasedataStationByStationId(stationId);
    }

    public BasedataStation getStationTypeByPatrolPointId(String patrolPointId) {
        return this.basedataStationMapper.getStationTypeByPatrolPointId(patrolPointId);
    }

    public int checkStationNameIsExit(String stationName, String stationNo, String stationId) {
        return this.basedataStationMapper.checkStationNameIsExit(stationName, stationNo, stationId);
    }

    public List<Map> getStationNameList() {
        return this.basedataStationMapper.getStationNameList();
    }
}
