package com.uas.platform.b2b.dao;

import com.uas.platform.b2b.model.PagingReleaseDetail;
import org.springframework.data.jpa.repository.JpaRepository;
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.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by dongbw
 * 17/03/23 9:39.
 */
@Repository
public interface PagingReleaseDetailDao extends JpaRepository<PagingReleaseDetail, Long>,JpaSpecificationExecutor<PagingReleaseDetail> {

    /**
     * 将消息设置成已推送
     *
     * @param ids
     */
    @Modifying@Transactional
    @Query("update PagingReleaseDetail o set o.pushStatus = 1 where o.id in :ids")
    void setPushedByIds(@Param("ids") Object[] ids);
}
