package com.huiju.estateagents.property.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.huiju.estateagents.property.model.TpAnnouncement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

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

    int insert(TpAnnouncement record);

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

    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 orgId
     * @param sum
     * @return
     */
//    List<TpAnnouncement> getAnnouncement(@Param("orgId") Integer orgId, @Param("sum") Integer sum);

    IPage<TpAnnouncement> getWxAnnouncements(Page page, @Param("orgId") Integer orgId, @Param("title") String title, @Param("annType") String annType,@Param("communityId") Integer communityId);
}