package com.cpxt.biz.service.impl;

import java.util.Arrays;
import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cpxt.biz.domain.StatCar;
import com.cpxt.biz.mapper.StatCarMapper;
import com.cpxt.biz.service.IStatCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 车辆统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-31
 */
@Service
public class StatCarServiceImpl implements IStatCarService
{
    @Autowired
    private StatCarMapper statCarMapper;

    /**
     * 查询车辆统计
     * 
     * @param id 车辆统计主键
     * @return 车辆统计
     */
    @Override
    public StatCar selectStatCarById(Long id)
    {
        return statCarMapper.selectById(id);
    }

    /**
     * 查询车辆统计列表
     * 
     * @param statCar 车辆统计
     * @return 车辆统计
     */
    @Override
    public List<StatCar> selectStatCarList(StatCar statCar)
    {
        LambdaQueryWrapper<StatCar> queryWrapper = new LambdaQueryWrapper<>();
        return statCarMapper.selectList(queryWrapper);
    }

    /**
     * 新增车辆统计
     * 
     * @param statCar 车辆统计
     * @return 结果
     */
    @Override
    public int insertStatCar(StatCar statCar)
    {
        return statCarMapper.insert(statCar);
    }

    /**
     * 修改车辆统计
     * 
     * @param statCar 车辆统计
     * @return 结果
     */
    @Override
    public int updateStatCar(StatCar statCar)
    {
        return statCarMapper.updateById(statCar);
    }

    /**
     * 批量删除车辆统计
     * 
     * @param ids 需要删除的车辆统计主键
     * @return 结果
     */
    @Override
    public int deleteStatCarByIds(Long[] ids)
    {
        return statCarMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除车辆统计信息
     * 
     * @param id 车辆统计主键
     * @return 结果
     */
    @Override
    public int deleteStatCarById(Long id)
    {
        return statCarMapper.deleteById(id);
    }
}
