package com.community.huiju.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.community.huiju.model.TpAnnouncement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface TpAnnouncementMapper extends BaseMapper<TpAnnouncement> {
    int deleteByPrimaryKey(Integer id);

    int insert(TpAnnouncement record);

    TpAnnouncement selectByPrimaryKey(@Param("id") Integer id, @Param("communityId") Integer communityId);

    int updateByPrimaryKeySelective(@Param("id") Integer id, @Param("viewCount") Integer viewCount);

    int updateTpAnnouncement(TpAnnouncement record);

    IPage<TpAnnouncement> getAnnouncements(Page page ,@Param("record")TpAnnouncement record);

    List<TpAnnouncement> getById( @Param("record")TpAnnouncement record);

    /**
     * 公告轮播图
     * @param communityId
     * @param sum
     * @return
     */
    List<TpAnnouncement> getAnnouncement(@Param("communityId") Integer communityId, @Param("sum") Integer sum);
}