package com.estate.expert.admin.domain.business.car;
|
|
import com.estate.expert.admin.domain.common.EntityBaseRepository;
|
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;
|
import org.springframework.data.repository.query.Param;
|
|
import java.util.List;
|
|
public interface CarRepository extends EntityBaseRepository<Car> {
|
|
@Query("select c from Car c where (:departmentPath is null or :departmentPath = '' or c.departmentPath = :departmentPath) " +
|
"and (:keyword is null or :keyword = '' or c.name like %:keyword%) " +
|
"and c.deleted = false")
|
List<Car> listCars(@Param("departmentPath") String departmentPath,
|
@Param("keyword") String keyword);
|
|
@Query("select c from Car c where (:keyword is null or :keyword = '' " +
|
"or c.model like %:keyword% " +
|
"or c.name like %:keyword%) " +
|
"and c.deleted = false")
|
List<Car> listCars(String keyword);
|
|
}
|