package com.testor.module.messageNotice.dao;

import com.testor.module.messageNotice.model.domain.TMsgNotice;
import com.tongtech.tfw.backend.common.models.supers.SuperDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

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

/**
 * 消息通知Mapper接口
 *
 * @author testor-framework
 * @date 2022-05-18 19:38:47
 */
@Mapper
public interface TMsgNoticeDao extends SuperDao<TMsgNotice> {

    @Select("select receiver_type, receiver_obj from ${tableName} where id = '${id}'")
    Map selectReceiverObjById(@Param(value = "tableName") String tableName, @Param(value = "id") String id);

    /**
     * 统计用户 每个流程定义中 未读的个数
     */
    List<Map> countUnRead(@Param("userId") String userId);

}
