package com.yihu.jw.complaint;

import com.yihu.jw.entity.base.complaint.BaseComplaintDictDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
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 BaseComplaintDictDao extends PagingAndSortingRepository<BaseComplaintDictDO, String>, JpaSpecificationExecutor<BaseComplaintDictDO> {
    @Query("from BaseComplaintDictDO t where t.isDel='1' and t.id=?1")
    BaseComplaintDictDO findById(String id);
    @Query("from BaseComplaintDictDO t where t.isDel='1' and t.name like %?1% order by t.createTime desc")
    List<BaseComplaintDictDO> findByName(String name);
    @Query("from BaseComplaintDictDO t where t.isDel='1' order by t.createTime desc")
    List<BaseComplaintDictDO> findByAll();
}
