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.BizCarState;
import com.cpxt.biz.mapper.BizCarStateMapper;
import com.cpxt.biz.service.IBizCarStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 车辆实时状态Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-18
 */
@Service
public class BizCarStateServiceImpl implements IBizCarStateService
{
    @Autowired
    private BizCarStateMapper bizCarStateMapper;

    /**
     * 查询车辆实时状态
     * 
     * @param id 车辆实时状态主键
     * @return 车辆实时状态
     */
    @Override
    public BizCarState selectBizCarStateById(Long id)
    {
        return bizCarStateMapper.selectById(id);
    }

    /**
     * 查询车辆实时状态列表
     * 
     * @param bizCarState 车辆实时状态
     * @return 车辆实时状态
     */
    @Override
    public List<BizCarState> selectBizCarStateList(BizCarState bizCarState)
    {
        LambdaQueryWrapper<BizCarState> queryWrapper = new LambdaQueryWrapper<>();

        return bizCarStateMapper.selectList(queryWrapper);
    }

    /**
     * 新增车辆实时状态
     * 
     * @param bizCarState 车辆实时状态
     * @return 结果
     */
    @Override
    public int insertBizCarState(BizCarState bizCarState)
    {
        return bizCarStateMapper.insert(bizCarState);
    }

    /**
     * 修改车辆实时状态
     * 
     * @param bizCarState 车辆实时状态
     * @return 结果
     */
    @Override
    public int updateBizCarState(BizCarState bizCarState)
    {
        return bizCarStateMapper.updateById(bizCarState);
    }

    /**
     * 批量删除车辆实时状态
     * 
     * @param ids 需要删除的车辆实时状态主键
     * @return 结果
     */
    @Override
    public int deleteBizCarStateByIds(Long[] ids)
    {
        return bizCarStateMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除车辆实时状态信息
     * 
     * @param id 车辆实时状态主键
     * @return 结果
     */
    @Override
    public int deleteBizCarStateById(Long id)
    {
        return bizCarStateMapper.deleteById(id);
    }
}
