package com.ruoyi.model.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.ruoyi.model.mapper.TransactionDetailsMapper;
import com.ruoyi.model.domain.TransactionDetails;
import com.ruoyi.model.service.ITransactionDetailsService;

/**
 * 交易明细记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class TransactionDetailsServiceImpl implements ITransactionDetailsService 
{
    @Autowired
    private TransactionDetailsMapper transactionDetailsMapper;

    /**
     * 查询交易明细记录
     * 
     * @param id 交易明细记录主键
     * @return 交易明细记录
     */
    @Override
    public TransactionDetails selectTransactionDetailsById(Long id)
    {
        return transactionDetailsMapper.selectTransactionDetailsById(id);
    }

    /**
     * 查询交易明细记录列表
     * 
     * @param transactionDetails 交易明细记录
     * @return 交易明细记录
     */
    @Override
    public List<TransactionDetails> selectTransactionDetailsList(TransactionDetails transactionDetails)
    {
        return transactionDetailsMapper.selectTransactionDetailsList(transactionDetails);
    }

    /**
     * 新增交易明细记录
     * 
     * @param transactionDetails 交易明细记录
     * @return 结果
     */
    @Override
    public int insertTransactionDetails(TransactionDetails transactionDetails)
    {
        transactionDetails.setCreateTime(DateUtils.getNowDate());
        return transactionDetailsMapper.insertTransactionDetails(transactionDetails);
    }

    /**
     * 修改交易明细记录
     * 
     * @param transactionDetails 交易明细记录
     * @return 结果
     */
    @Override
    public int updateTransactionDetails(TransactionDetails transactionDetails)
    {
        return transactionDetailsMapper.updateTransactionDetails(transactionDetails);
    }

    /**
     * 批量删除交易明细记录
     * 
     * @param ids 需要删除的交易明细记录主键
     * @return 结果
     */
    @Override
    public int deleteTransactionDetailsByIds(Long[] ids)
    {
        return transactionDetailsMapper.deleteTransactionDetailsByIds(ids);
    }

    /**
     * 删除交易明细记录信息
     * 
     * @param id 交易明细记录主键
     * @return 结果
     */
    @Override
    public int deleteTransactionDetailsById(Long id)
    {
        return transactionDetailsMapper.deleteTransactionDetailsById(id);
    }

    @Override
    public List<TransactionDetails> getTransactionDetailsList() {
        return transactionDetailsMapper.getTransactionDetailsList();
    }
}
