package com.reyun.repository;

import com.reyun.model.CallbackCustomize;
import com.reyun.model.CallbackNextday;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CallbackNextdayRepository extends JpaRepository<CallbackNextday, Long> {


    @Query(value = "select * from callback_nextday where app = ?1",nativeQuery = true)
    CallbackNextday findByApp(Long app);

    @Query(value = "select * from callback_nextday where app = ?1 and active in (0,1)",nativeQuery = true)
    List<CallbackNextday> findByAppNotDel(Long appid);

    @Query(value = "select * from callback_nextday where app = ?1 and channel = ?2 and what = ?3 and active in (0,1)",nativeQuery = true)
    List<CallbackNextday> findByAppChannel(Long app, Long channel, String what);
}