package com.jeeplus.flowable.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.flowable.model.ActRuTaskInfo;
import com.jeeplus.flowable.model.MyNoticeList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MyNoticeListMapper extends BaseMapper<MyNoticeList> {

    void readAll(@Param("name") String name);

    /**
     * 查询通知信息
     *
     * @param myNotice
     * @return
     */
    public IPage<MyNoticeList> selectPage(Page<MyNoticeList> page, @Param("myNotice") MyNoticeList myNotice);

    /**
     * 根据通知信息查询详情
     * @param myNoticeList
     * @return
     */
    MyNoticeList getRepetitionCountBymyNotice(MyNoticeList myNoticeList);

    /**
     * 保存通知信息
     * @param myNoticeList
     */
    void insertMyNotice(MyNoticeList myNoticeList);

    /**
     * 修改通知信息
     * @param myNoticeList
     */
    void updateMyNotice(MyNoticeList myNoticeList);

    /**
     * 根据通知信息查询详情
     * @param myNoticeList
     * @return
     */
    MyNoticeList getRepetitionCountBymyNoticeTitle(MyNoticeList myNoticeList);

    /**
     * 部分通知变更为已读
     * @param idList
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    void portionRead(@Param("idList")List idList);

    /**
     * 查询 流程信息
     * @param id
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    ActRuTaskInfo getTaskInfoByID(@Param("id")String id);

    /**
     * 查询我的通知列表数据
     * @param page
     * @param queryWrapper
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    Page<MyNoticeList> selectNoticePage(Page<MyNoticeList> page, @Param(Constants.WRAPPER)QueryWrapper<MyNoticeList> queryWrapper);

    /**
     * 查询我的通知列表数据
     * @param page
     * @param queryWrapper
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    IPage<MyNoticeList> selectNoticePage2(Page<MyNoticeList> page, @Param(Constants.WRAPPER)QueryWrapper<MyNoticeList> queryWrapper);

    /**
     *查询通知信息
     * @param wrapper
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    MyNoticeList selectInfo(@Param(Constants.WRAPPER) LambdaQueryWrapper<MyNoticeList> wrapper);

    /**
     * 根据id修改查看状态
     * @param id
     */
    @InterceptorIgnore(tenantLine = "true")
    void updateInfoById(@Param("id")String id);
}
