package com.sonic.lion.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sonic.lion.domain.entity.AccountBuffAwaiting;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountBuffAwaitingDao extends BaseMapper<AccountBuffAwaiting> {

    /**
     * 查询将要入账的记录
     *
     * @param num
     * @return
     */
    List<AccountBuffAwaiting> selectWillToIncome(@Param("num") Integer num);

    @Update("UPDATE account_buff_awaiting SET to_withdrawable_income_time=NOW()  WHERE fronzen_status='UN_FRONZEN' AND STATUS =0 AND to_withdrawable_income_time < DATE_SUB( NOW() ,INTERVAL  3 DAY)")
    int updateOldData();
}