package com.rf.psychological.douyin.repository;

import com.rf.psychological.base.repository.BaseRepository;
import com.rf.psychological.douyin.model.DouYinOrderEntity;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;

import java.util.List;

/**
 * @Description:抖音订单
 * @Author: mimang
 * @Date: 2023/8/17
 */
@ConditionalOnProperty(prefix="douyin",name = "isDouYin", havingValue = "true")
public interface DouYinOrderRepository extends BaseRepository<DouYinOrderEntity,String> {

    /**
     * 根据结果Id获取订单信息
     * @param result
     * @param status
     * @return
     */
    DouYinOrderEntity findFirstByResultIdAndOrderStatus(String result,String status);

    /**
     * 根据订单编号查询
     * @param outOrderNo 订单编号
     * @return
     */
    DouYinOrderEntity findByOutOrderNo(String outOrderNo);

    List<DouYinOrderEntity> findAllByOrderStatus(String type);

    /**
     * 根据订单编号删除该订单
     * @param outOrderByNo
     */
    void deleteByOutOrderNo(String outOrderByNo);
}
