package cn.palmte.work.model;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ProcurementTypeRepository extends JpaRepository<ProcurementType,Integer> {
    List<ProcurementType> findAllByEnabledEqualsAndIsDeletedEquals(int enable,int deleted);

    @Query(value = "select * from procurement_type where name = ?1 and enabled = 1 and is_deleted = 0 limit 1", nativeQuery = true)
    ProcurementType findByName(String category);
}
