package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.mapper.PointsTransactionMapper;
import com.ruoyi.system.domain.PointsTransaction;
import com.ruoyi.system.service.IPointsTransactionService;

/**
 * 积分流水Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-30
 */
@Service
public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<PointsTransaction>,PointsTransaction> implements IPointsTransactionService
{
    @Autowired
    private PointsTransactionMapper pointsTransactionMapper;

    /**
     * 查询积分流水
     *
     * @param id 积分流水主键
     * @return 积分流水
     */
    @Override
    public PointsTransaction selectPointsTransactionById(Long id)
    {
        return pointsTransactionMapper.selectPointsTransactionById(id);
    }

    /**
     * 查询积分流水列表
     *
     * @param pointsTransaction 积分流水
     * @return 积分流水
     */
    @Override
    public List<PointsTransaction> selectPointsTransactionList(PointsTransaction pointsTransaction)
    {
        return pointsTransactionMapper.selectPointsTransactionList(pointsTransaction);
    }

    /**
     * 新增积分流水
     *
     * @param pointsTransaction 积分流水
     * @return 结果
     */
    @Override
    public int insertPointsTransaction(PointsTransaction pointsTransaction)
    {
        pointsTransaction.setCreateTime(DateUtils.getNowDate());
        return pointsTransactionMapper.insertPointsTransaction(pointsTransaction);
    }

    /**
     * 修改积分流水
     *
     * @param pointsTransaction 积分流水
     * @return 结果
     */
    @Override
    public int updatePointsTransaction(PointsTransaction pointsTransaction)
    {
        pointsTransaction.setUpdateTime(DateUtils.getNowDate());
        return pointsTransactionMapper.updatePointsTransaction(pointsTransaction);
    }

    /**
     * 批量删除积分流水
     *
     * @param ids 需要删除的积分流水主键
     * @return 结果
     */
    @Override
    public int deletePointsTransactionByIds(Long[] ids)
    {
        return pointsTransactionMapper.deletePointsTransactionByIds(ids);
    }

    /**
     * 删除积分流水信息
     *
     * @param id 积分流水主键
     * @return 结果
     */
    @Override
    public int deletePointsTransactionById(Long id)
    {
        return pointsTransactionMapper.deletePointsTransactionById(id);
    }
}
