package com.yihu.jw.complaint;

import com.yihu.jw.entity.base.complaint.BaseComplaintDO;
import com.yihu.jw.entity.base.complaint.BaseComplaintDictDO;
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 BaseComplaintDao extends PagingAndSortingRepository<BaseComplaintDO, String>, JpaSpecificationExecutor<BaseComplaintDO> {
    @Query("select count(1) from BaseComplaintDO t where t.isDel='1' and t.status=?1 and t.complaintId=?2")
    Integer getCountByStatusAndComplaintId(String status,String complatientId);

    @Query("select count(1) from BaseComplaintDO t where t.isDel='1' and t.status=?1 ")
    Integer getCountByStatus(String status);


    @Query("select count(1) from BaseComplaintDO t where t.isDel='1' and t.status=?1  and t.patient=?2")
    Integer getCountByStatusByPatient(String status,String patient);
}
