package com.yihu.jw.dict.dao;

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

import java.util.List;

/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/6/18
 */
public interface DictDeptDescDao extends PagingAndSortingRepository<DictDeptDescDO, String>, JpaSpecificationExecutor<DictDeptDescDO> {

    DictDeptDescDO findByDeptCodeAndOrgCode(String deptCode,String orgCode);

    @Query("from DictDeptDescDO where orgCode=?1  order by deptCode ASC")
    List<DictDeptDescDO> findByOrgCode(String orgCode);

    @Query("from DictDeptDescDO where orgCode=?1  and deptName like %?2% order by deptCode ASC")
    List<DictDeptDescDO> findByOrgCode(String orgCode,String keyName);
}
