package cn.iocoder.yudao.module.jx.service.impl;

import cn.iocoder.yudao.module.jx.domain.DriveSchoolUpkeep;
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolUpkeepMapper;
import cn.iocoder.yudao.module.jx.service.IDriveSchoolUpkeepService;
import cn.iocoder.yudao.module.jx.utils.DateUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车辆保养记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-01
 */
@Service
public class DriveSchoolUpkeepServiceImpl implements IDriveSchoolUpkeepService
{
    @Autowired
    private DriveSchoolUpkeepMapper driveSchoolUpkeepMapper;

    /**
     * 查询车辆保养记录
     *
     * @param id 车辆保养记录主键
     * @return 车辆保养记录
     */
    @Override
    public DriveSchoolUpkeep selectDriveSchoolUpkeepById(Long id)
    {
        return driveSchoolUpkeepMapper.selectDriveSchoolUpkeepById(id);
    }

    /**
     * 查询车辆保养记录列表
     *
     * @param driveSchoolUpkeep 车辆保养记录
     * @return 车辆保养记录
     */
    @Override
    public IPage<DriveSchoolUpkeep> selectDriveSchoolUpkeepList(DriveSchoolUpkeep driveSchoolUpkeep, Page<DriveSchoolUpkeep> page)
    {
        return driveSchoolUpkeepMapper.selectDriveSchoolUpkeepList(driveSchoolUpkeep,page);
    }

    /**
     * 新增车辆保养记录
     *
     * @param driveSchoolUpkeep 车辆保养记录
     * @return 结果
     */
    @Override
    public int insertDriveSchoolUpkeep(DriveSchoolUpkeep driveSchoolUpkeep)
    {
        return driveSchoolUpkeepMapper.insertDriveSchoolUpkeep(driveSchoolUpkeep);
    }

    /**
     * 修改车辆保养记录
     *
     * @param driveSchoolUpkeep 车辆保养记录
     * @return 结果
     */
    @Override
    public int updateDriveSchoolUpkeep(DriveSchoolUpkeep driveSchoolUpkeep)
    {
        //driveSchoolUpkeep.setUpdateTime(DateUtils.getNowDate());
        return driveSchoolUpkeepMapper.updateDriveSchoolUpkeep(driveSchoolUpkeep);
    }

    /**
     * 批量删除车辆保养记录
     *
     * @param ids 需要删除的车辆保养记录主键
     * @return 结果
     */
    @Override
    public int deleteDriveSchoolUpkeepByIds(Long[] ids)
    {
        return driveSchoolUpkeepMapper.deleteDriveSchoolUpkeepByIds(ids);
    }

    /**
     * 删除车辆保养记录信息
     *
     * @param id 车辆保养记录主键
     * @return 结果
     */
    @Override
    public int deleteDriveSchoolUpkeepById(Long id)
    {
        return driveSchoolUpkeepMapper.deleteDriveSchoolUpkeepById(id);
    }
}
