package org.dromara.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.SysNotice;
import org.dromara.system.domain.bo.SysNoticeBo;
import org.dromara.system.domain.vo.SysNoticeVo;

/**
 * 通知公告表 数据层
 *
 * @author Lion Li
 */
public interface SysNoticeMapper extends BaseMapperPlus<SysNotice, SysNoticeVo> {

    Page<SysNoticeVo> selectPageNoticeListByUser(@Param("page") Page<SysNoticeVo> build,
                                                 @Param("ew") QueryWrapper<SysNotice> lqw,
                                                 @Param("userId") Long userId);


    int selectNoticeReadByUser(@Param("userId") Long userId, @Param("noticeId") Long noticeId);

    void insertNoticeRead(@Param("userId") Long userId, @Param("noticeId") Long noticeId);

    void insertNoticeRole(@Param("noticeId") Long noticeId, @Param("busRoles") Integer[] busRoles);

    void deleteNoticeRole(@Param("noticeId") Long noticeId);
}
