package com.ruoyi.ss.checkoff.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.checkoff.mapper.CheckoffRecordsMapper;
import com.ruoyi.ss.checkoff.domain.CheckoffRecords;
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsVO;
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsQuery;
import com.ruoyi.ss.checkoff.service.ICheckoffRecordsService;

/**
 * 核销记录Service业务层处理
 *
 * @author qzz
 * @date 2025-03-18
 */
@Service
public class CheckoffRecordsServiceImpl implements ICheckoffRecordsService
{
    @Autowired
    private CheckoffRecordsMapper checkoffRecordsMapper;

    /**
     * 查询核销记录
     *
     * @param checkoffId 核销记录主键
     * @return 核销记录
     */
    @Override
    public CheckoffRecordsVO selectCheckoffRecordsByCheckoffId(Long checkoffId)
    {
        return checkoffRecordsMapper.selectCheckoffRecordsByCheckoffId(checkoffId);
    }

    /**
     * 查询核销记录列表
     *
     * @param checkoffRecords 核销记录
     * @return 核销记录
     */
    @Override
    public List<CheckoffRecordsVO> selectCheckoffRecordsList(CheckoffRecordsQuery checkoffRecords)
    {
        return checkoffRecordsMapper.selectCheckoffRecordsList(checkoffRecords);
    }

    /**
     * 新增核销记录
     *
     * @param checkoffRecords 核销记录
     * @return 结果
     */
    @Override
    public int insertCheckoffRecords(CheckoffRecords checkoffRecords)
    {
        return checkoffRecordsMapper.insertCheckoffRecords(checkoffRecords);
    }

    /**
     * 修改核销记录
     *
     * @param checkoffRecords 核销记录
     * @return 结果
     */
    @Override
    public int updateCheckoffRecords(CheckoffRecords checkoffRecords)
    {
        return checkoffRecordsMapper.updateCheckoffRecords(checkoffRecords);
    }

    /**
     * 批量删除核销记录
     *
     * @param checkoffIds 需要删除的核销记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckoffRecordsByCheckoffIds(Long[] checkoffIds)
    {
        return checkoffRecordsMapper.deleteCheckoffRecordsByCheckoffIds(checkoffIds);
    }

    /**
     * 删除核销记录信息
     *
     * @param checkoffId 核销记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckoffRecordsByCheckoffId(Long checkoffId)
    {
        return checkoffRecordsMapper.deleteCheckoffRecordsByCheckoffId(checkoffId);
    }

    /**
     * 最后一条核销记录
     *
     * @param cardId 卡券id
     * @return 结果
     */
    @Override
    public CheckoffRecords selectCheckoffRecordsByCardId(Long cardId) {
        return checkoffRecordsMapper.selectCheckoffRecordsByCardId(cardId);
    }
}
