package com.xy.xyaicpzs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xy.xyaicpzs.domain.entity.VipExchangeRecord;
import com.xy.xyaicpzs.service.VipExchangeRecordService;
import com.xy.xyaicpzs.mapper.VipExchangeRecordMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author XY003
* @description 针对表【vip_exchange_record(会员兑换表)】的数据库操作Service实现
* @createDate 2025-06-19 11:27:10
*/
@Service
public class VipExchangeRecordServiceImpl extends ServiceImpl<VipExchangeRecordMapper, VipExchangeRecord>
    implements VipExchangeRecordService{

    @Override
    public List<VipExchangeRecord> getExchangeRecordsByUserId(Long userId) {
        QueryWrapper<VipExchangeRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("userId", userId)
                   .orderByDesc("exchangeTime");
        return list(queryWrapper);
    }
}




