package com.ssj.dao.weixin.library.dao;

import com.ssj.bean.weixin.libmy.domain.TbLibManagerBanned;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Mount Liu
 * @date 2019/10/24
 */
@Repository
public interface LibManagerBannedDao extends JpaRepository<TbLibManagerBanned, String> {

    @Query(nativeQuery = true, value = "select * from tb_lib_manager_banned where lib_manager_id = ?1 and create_time REGEXP ?2 order by create_time desc")
    List<TbLibManagerBanned> findByLibManagerIdAndDate(String libManagerId, String date);

    @Query(nativeQuery = true, value = "select * from tb_lib_manager_banned where user_id = ?1")
    List<TbLibManagerBanned> findByUserId(String userId);
}
