AppRepository.java 836 Bytes
Newer Older
manxiaoqiang committed
1 2 3 4 5 6 7
package tkio.repository;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import tkio.model.App;

8
import java.math.BigInteger;
manxiaoqiang committed
9 10 11 12 13 14 15
import java.util.List;

public interface AppRepository extends JpaRepository<App, Long> {

	@Query(value = "select * from app where account in (select id from account where parent = ?1 or id = ?1) and del_flag is not true", nativeQuery = true)
	List<App> listAppByRootAccount(Long account);

16
	@Query(value = "select count(*) from app where account  in ?1 and create_time >= ?2 and create_time <= ?3", nativeQuery = true)
17
	BigInteger countByAccount(List<Long> accountId, String startDate, String endDate);
manxiaoqiang committed
18

19 20
	@Query(value = "select appkey from app where account  in ?1", nativeQuery = true)
	List<String> findAppkeys(List<Long> accountId);
manxiaoqiang committed
21
}