package com.yihu.jw.base.dao.equipment;

import com.yihu.jw.entity.base.doctor.BaseModuleRoleDO;
import com.yihu.jw.entity.equipment.WlyyUserAreaDO;
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 WlyyUserAreaDao extends PagingAndSortingRepository<WlyyUserAreaDO, String>, JpaSpecificationExecutor<WlyyUserAreaDO> {

    @Query("select id from WlyyUserAreaDO where userId = ?1 ")
    List<WlyyUserAreaDO> findAllByUserId(String userId);

    @Modifying
    @Query("delete from WlyyUserAreaDO p where p.userId=?1 ")
    void deleteByUserId(String userId);
}
