package com.yihu.jw.dict.dao;

import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface BaseJobCategoryDao extends PagingAndSortingRepository<BaseJobCategoryDO, Integer>, JpaSpecificationExecutor<BaseJobCategoryDO> {
    @Query("from BaseJobCategoryDO t where t.pid = '0' and t.del = 1")
    List<BaseJobCategoryDO> findFirstCategoryList();
    @Query("from BaseJobCategoryDO t where t.pid = ?1 and t.del = 1")
    List<BaseJobCategoryDO> findSecondCategoryList(String pid);
    @Query("from BaseJobCategoryDO t where t.name = ?1 and t.del = 1")
    BaseJobCategoryDO findByName(String name);
}
