package com.yihu.jw.hospital.drugstore.dao;

import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.area.BaseDrugStoreTimeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface BaseDrugStoreTimeDao extends PagingAndSortingRepository<BaseDrugStoreTimeDO, String>, JpaSpecificationExecutor<BaseDrugStoreTimeDO> {
    @Modifying
    @Query("delete from BaseDrugStoreTimeDO  where drugStoreId = ?1")
    void deleteByDrugStoreId(String drugStoreId);
    @Query("from BaseDrugStoreTimeDO where drugStoreId =?1 order by  weekDay asc ,amPm asc")
    List<BaseDrugStoreTimeDO> findByDrugStoreId(String drugStoreId);
}
