package com.ruoyi.base.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.DlBaseEntity;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.base.mapper.BaseCouponMapper;
import com.ruoyi.base.domain.BaseCoupon;
import com.ruoyi.base.service.IBaseCouponService;

/**
 * 通告券Service业务层处理
 * 
 * @author vinjor-m
 * @date 2025-03-17
 */
@Service
public class BaseCouponServiceImpl extends ServiceImpl<BaseCouponMapper,BaseCoupon>  implements IBaseCouponService
{
    @Autowired
    private BaseCouponMapper baseCouponMapper;

    @Override
    public IPage<BaseCoupon> queryListPage(BaseCoupon pageReqVO, Page<BaseCoupon> page) {
        return baseCouponMapper.queryListPage(pageReqVO, page);
    }

    /**
     * 不分页查询基础通告券列表
     *
     * @return java.util.List<com.ruoyi.base.domain.BaseCoupon>
     * @author PQZ
     * @date 13:54 2025/4/11
     **/
    @Override
    public List<BaseCoupon> couponList() {
        LambdaQueryWrapper<BaseCoupon> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(DlBaseEntity::getDelFlag,0)
                .eq(BaseCoupon::getIsShow,1)
                .orderByDesc(DlBaseEntity::getCreateTime);
        return list(lambdaQueryWrapper);
    }
}
