package com.jxy.order.mapper;

import com.jxy.common.datasource.annotation.Master;
import com.jxy.order.entity.AddCreditOrder;
import com.jxy.order.entity.Consume;
import com.jxy.order.entity.LevelUpOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description TODO
 * @Date 2023/5/31 15:27
 * @Author 杜懿
 */
@Master
public interface ConsumeMapper {

    /**
     * 根据用户id查询当前用户是否有正在处理的升级订单
     * @param userId
     * @return
     */
    public int checkOrderIfExistByUserId(@Param("userId") Long userId);

    public boolean insertConsume(@Param("dto") LevelUpOrder dto);

    public boolean updateConsumeState(@Param("dto") LevelUpOrder dto);

    /**
     *根据用户id获取用户所有消费记录
     * @param userId
     * @return
     */
    public List<Consume> getConsumeByUserId(@Param("userId") Long userId, @Param("state") Integer state);

}
