package com.zehong.system.service.impl;

import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TCarMapper;
import com.zehong.system.domain.TCar;
import com.zehong.system.service.ITCarService;

/**
 * 巡检车Service业务层处理
 * 
 * @author zehong
 * @date 2026-05-15
 */
@Service
public class TCarServiceImpl implements ITCarService 
{
    @Autowired
    private TCarMapper tCarMapper;

    /**
     * 查询巡检车
     * 
     * @param id 巡检车ID
     * @return 巡检车
     */
    @Override
    public TCar selectTCarById(Long id)
    {
        return tCarMapper.selectTCarById(id);
    }

    /**
     * 查询巡检车列表
     * 
     * @param tCar 巡检车
     * @return 巡检车
     */
    @Override
    public List<TCar> selectTCarList(TCar tCar)
    {
        return tCarMapper.selectTCarList(tCar);
    }

    /**
     * 新增巡检车
     * 
     * @param tCar 巡检车
     * @return 结果
     */
    @Override
    public int insertTCar(TCar tCar)
    {
        tCar.setCreateTime(DateUtils.getNowDate());
        return tCarMapper.insertTCar(tCar);
    }

    /**
     * 修改巡检车
     * 
     * @param tCar 巡检车
     * @return 结果
     */
    @Override
    public int updateTCar(TCar tCar)
    {
        return tCarMapper.updateTCar(tCar);
    }

    /**
     * 批量删除巡检车
     * 
     * @param ids 需要删除的巡检车ID
     * @return 结果
     */
    @Override
    public int deleteTCarByIds(Long[] ids)
    {
        return tCarMapper.deleteTCarByIds(ids);
    }

    /**
     * 删除巡检车信息
     * 
     * @param id 巡检车ID
     * @return 结果
     */
    @Override
    public int deleteTCarById(Long id)
    {
        return tCarMapper.deleteTCarById(id);
    }
}
