package com.yihu.jw.hospital.dict;

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

import javax.transaction.Transactional;
import java.util.List;

/**
 * Created by zdm on 2019/5/28.
 */
@Transactional
public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyChargeDictDO, String>, JpaSpecificationExecutor<WlyyChargeDictDO> {
    @Query("from WlyyChargeDictDO t where t.deptTypeCode=?1 and t.isDel='1'")
    List<WlyyChargeDictDO>  findByDeptTypeCode(String deptTypeCode);
    @Query("from WlyyChargeDictDO d where 1=1 and d.isDel='1'")
    List<WlyyChargeDictDO>  findAllDict();
    @Query("from WlyyChargeDictDO t where t.chargeType=?1 and t.deptTypeCode=?2 and t.isDel='1'")
    WlyyChargeDictDO  findByChargeTypeAndDeptTypeCode(String chargeType,String deptTypeCode);
    @Query("from WlyyChargeDictDO t where t.chargeType=?1  and t.isDel='1'")
    WlyyChargeDictDO  findByChargeType(String chargeType);

    @Query("from WlyyChargeDictDO d where d.reqFee = ?1 and d.isDel='1' ")
    WlyyChargeDictDO  findByReqFee(Double reqFee);
}
