package com.wzj.soopin.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzj.soopin.order.domain.entity.RedPacket;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RedPacketMapper extends BaseMapper<RedPacket> {

    @Select("SELECT * FROM oms_red_packet WHERE expire_time < NOW() AND status IN (0, 1)")
    List<RedPacket> selectExpiredRedPackets();
}
