package com.fastbee.rechargecard.service.impl;

import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.rechargecard.mapper.UserConsumptionDetailsMapper;
import com.fastbee.rechargecard.domain.UserConsumptionDetails;
import com.fastbee.rechargecard.service.IUserConsumptionDetailsService;

/**
 * 用户充值卡账单明细记录Service业务层处理
 *
 * @author kerwincui
 * @date 2024-12-18
 */
@Service
public class UserConsumptionDetailsServiceImpl implements IUserConsumptionDetailsService
{
    @Autowired
    private UserConsumptionDetailsMapper userConsumptionDetailsMapper;

    /**
     * 根据卡号查询用户充值卡账单明细记录列表
     *
     * @param cardNumber 用户充值卡号
     * @return 用户充值卡账单明细记录
     */
    @Override
    public List<UserConsumptionDetails> selectUserConsumptionDetailsListById(String cardNumber)
    {
        return userConsumptionDetailsMapper.selectUserConsumptionDetailsListById(cardNumber);
    }

    /**
     * 查询用户充值卡账单明细记录
     *
     * @param id 用户充值卡账单明细记录主键
     * @return 用户充值卡账单明细记录
     */
    @Override
    public UserConsumptionDetails selectUserConsumptionDetailsById(Long id)
    {
        return userConsumptionDetailsMapper.selectUserConsumptionDetailsById(id);
    }

    /**
     * 查询用户充值卡账单明细记录列表
     *
     * @param userConsumptionDetails 用户充值卡账单明细记录
     * @return 用户充值卡账单明细记录
     */
    @Override
    public List<UserConsumptionDetails> selectUserConsumptionDetailsList(UserConsumptionDetails userConsumptionDetails)
    {
        return userConsumptionDetailsMapper.selectUserConsumptionDetailsList(userConsumptionDetails);
    }

    /**
     * 新增用户充值卡账单明细记录
     *
     * @param userConsumptionDetails 用户充值卡账单明细记录
     * @return 结果
     */
    @Override
    public int insertUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails)
    {
        userConsumptionDetails.setCreateTime(DateUtils.getNowDate());
        return userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails);
    }

    /**
     * 修改用户充值卡账单明细记录
     *
     * @param userConsumptionDetails 用户充值卡账单明细记录
     * @return 结果
     */
    @Override
    public int updateUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails)
    {
        userConsumptionDetails.setUpdateTime(DateUtils.getNowDate());
        return userConsumptionDetailsMapper.updateUserConsumptionDetails(userConsumptionDetails);
    }

    /**
     * 批量删除用户充值卡账单明细记录
     *
     * @param ids 需要删除的用户充值卡账单明细记录主键
     * @return 结果
     */
    @Override
    public int deleteUserConsumptionDetailsByIds(Long[] ids)
    {
        return userConsumptionDetailsMapper.deleteUserConsumptionDetailsByIds(ids);
    }

    /**
     * 删除用户充值卡账单明细记录信息
     *
     * @param id 用户充值卡账单明细记录主键
     * @return 结果
     */
    @Override
    public int deleteUserConsumptionDetailsById(Long id)
    {
        return userConsumptionDetailsMapper.deleteUserConsumptionDetailsById(id);
    }
}
