package com.fdkankan.ucenter.mapper;

import com.fdkankan.ucenter.entity.UserIncrement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户增值权益表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2022-07-04
 */
@Mapper
public interface IUserIncrementMapper extends BaseMapper<UserIncrement> {

    @Select("SELECT * FROM `t_user_increment` WHERE DATEDIFF(increment_end_time,NOW()) = #{date} AND is_expired = #{isExpired} AND subscription_order is null and  rec_status = 'A'  ")
    List<UserIncrement> findReadyExpire(@Param("date")Integer date, @Param("isExpired")Integer isExpired);
}
