BackVisitRepository.java 1.01 KB
Newer Older
manxiaoqiang committed
1 2
package common.repository;

3
import common.model.*;
manxiaoqiang committed
4 5 6 7 8 9 10 11 12 13 14 15
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import tkio.model.Account;

import java.util.List;

@Transactional
public interface BackVisitRepository extends JpaRepository<BackVisit, Long> {

    @Query(value = "SELECT * from back_visit", nativeQuery = true)
    List<BackVisit> findAllCount();
16

17
    @Query(value = "select * from back_visit where account_id  = ?1 and ds >= ?2 and ds <= ?3 and platform = ?4", nativeQuery = true)
18
    List<BackVisit> findAll(Long accountId, String startDate, String endDate, String platform);
19 20 21

    @Query(value = "select * from back_visit where platform = ?1", nativeQuery = true)
    List<BackVisit> findAllByPlatform(String platform);
manxiaoqiang committed
22 23 24

    @Query(value = "select * from back_visit where platform = ?1 and email = ?2", nativeQuery = true)
    List<BackVisit> findAllByPlatformAndEmail(String platform, String email);
manxiaoqiang committed
25
}