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.DltDrawRecord;
import com.xy.xyaicpzs.service.DltDrawRecordService;
import com.xy.xyaicpzs.mapper.DltDrawRecordMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author XY003
* @description 针对表【dlt_draw_record(大乐透开奖信息表)】的数据库操作Service实现
* @createDate 2025-08-20 15:55:06
*/
@Service
public class DltDrawRecordServiceImpl extends ServiceImpl<DltDrawRecordMapper, DltDrawRecord>
    implements DltDrawRecordService{

    @Override
    public List<DltDrawRecord> getRecentDraws(Integer limit) {
        if (limit == null || limit <= 0) {
            limit = 10;
        }
        QueryWrapper<DltDrawRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByDesc("draw_id").last("LIMIT " + limit);
        return list(queryWrapper);
    }
}




