package com.ywt.outpatient.domain.entity.center;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface CheckUpOrderRepository extends JpaRepository<CheckUpOrder, Integer>, JpaSpecificationExecutor<CheckUpOrder> {

    /**
     * 位运算：订单状态(0-待支付，1-已支付，2-通知his成功，4-通知his失败)
     * @return
     */
    @Query(value = "select * from check_up_order where payment_status = 2 and deleted = 0 and status & 4 = 4 and create_time >= ? ;", nativeQuery = true)
    List<CheckUpOrder> getPushFilureList(Date date);
}