package com.ssj.dao.sys.push.dao;


import com.ssj.bean.sys.push.domain.SconPushMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface SconPushMessageDao extends JpaRepository<SconPushMessage, String> {
	@Query(nativeQuery = true, value = "SELECT t.content from scon_push_message t where t.push_user_id =?1 AND t.content LIKE CONCAT('%',?2,'%')   ORDER BY t.create_time desc LIMIT ?3  ")
	List<String> findByLikeContent(String pushUserId,String content,int limit);

	@Query(nativeQuery = true, value = "delete from scon_push_message  where push_user_id =?1  AND content LIKE CONCAT('%',?2,'%')  ")
	@Modifying
	public void deleteByLikeContent(String pushUserId,String content);
}
