package com.zehong.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TVehicleInfoMapper;
import com.zehong.system.domain.TVehicleInfo;
import com.zehong.system.service.ITVehicleInfoService;

/**
 * 燃气车辆信息Service业务层处理
 * 
 * @author zehong
 * @date 2022-03-17
 */
@Service
public class TVehicleInfoServiceImpl implements ITVehicleInfoService 
{
    @Autowired
    private TVehicleInfoMapper tVehicleInfoMapper;

    /**
     * 查询燃气车辆信息
     * 
     * @param vehicleId 燃气车辆信息ID
     * @return 燃气车辆信息
     */
    @Override
    public TVehicleInfo selectTVehicleInfoById(Long vehicleId)
    {
        return tVehicleInfoMapper.selectTVehicleInfoById(vehicleId);
    }

    /**
     * 查询燃气车辆信息列表
     * 
     * @param tVehicleInfo 燃气车辆信息
     * @return 燃气车辆信息
     */
    @Override
    public List<TVehicleInfo> selectTVehicleInfoList(TVehicleInfo tVehicleInfo)
    {
        return tVehicleInfoMapper.selectTVehicleInfoList(tVehicleInfo);
    }
    @Override
    public Integer countCar(Long deptId)
    {
        TVehicleInfo t = new TVehicleInfo();
        if(deptId>0){
            t.setBeyondEnterpriseId(deptId.intValue());
        }
        List<TVehicleInfo> list =  tVehicleInfoMapper.selectTVehicleInfoList(t);
        return list.size();
    }


    /**
     * 新增燃气车辆信息
     * 
     * @param tVehicleInfo 燃气车辆信息
     * @return 结果
     */
    @Override
    public int insertTVehicleInfo(TVehicleInfo tVehicleInfo)
    {
        return tVehicleInfoMapper.insertTVehicleInfo(tVehicleInfo);
    }

    /**
     * 修改燃气车辆信息
     * 
     * @param tVehicleInfo 燃气车辆信息
     * @return 结果
     */
    @Override
    public int updateTVehicleInfo(TVehicleInfo tVehicleInfo)
    {
        return tVehicleInfoMapper.updateTVehicleInfo(tVehicleInfo);
    }

    /**
     * 批量删除燃气车辆信息
     * 
     * @param vehicleIds 需要删除的燃气车辆信息ID
     * @return 结果
     */
    @Override
    public int deleteTVehicleInfoByIds(Long[] vehicleIds)
    {
        return tVehicleInfoMapper.deleteTVehicleInfoByIds(vehicleIds);
    }

    /**
     * 删除燃气车辆信息信息
     * 
     * @param vehicleId 燃气车辆信息ID
     * @return 结果
     */
    @Override
    public int deleteTVehicleInfoById(Long vehicleId)
    {
        return tVehicleInfoMapper.deleteTVehicleInfoById(vehicleId);
    }
}
