package com.yeejoin.amos.supervision.business.dao.repository;

import com.yeejoin.amos.supervision.dao.entity.Msg;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("iMsgDao")
public interface IMsgDao extends BaseDao<Msg, Long>{
	@Query(value = "select  count(1) from p_msg where user_id = ?1 and is_read = 0", nativeQuery = true)
	int countByUserId(String userId);

	List<Msg> findAllByIsImmediatelyFalse();

	List<Msg> findAllByIsImmediatelyTrueAndStatus(int status);
}
