SalesRepository.java 734 Bytes
Newer Older
kangxiaoshan committed
1 2 3 4 5 6 7 8 9 10
package common.repository;

import common.model.Sales;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SalesRepository extends JpaRepository<Sales, Long> {

kangxiaoshan committed
11
    @Query(value = "select * from sales where status = ?1 order by area_type,id",nativeQuery = true)
kangxiaoshan committed
12 13 14
    List<Sales> findSaleByStatus(Integer status);


kangxiaoshan committed
15
    @Query(value = "select * from sales where id = ?1 union all select * from sales where id =?2",nativeQuery = true)
kangxiaoshan committed
16 17 18 19 20 21
    List<Sales> findByTwoId(Long sale, Long sale1);

    @Query(value = "select * from sales where status = '0' order by area_type,id",nativeQuery = true)
    List<Sales> findAllByStatusOn( );

}