package com.sckw.message.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.message.model.KwmMessageUser;
import com.sckw.message.model.dto.UserMsgCenterLatestMsgDTO;
import com.sckw.message.model.dto.UserMsgCenterReqDTO;
import com.sckw.message.model.vo.res.UserCenterMsgVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @desc: 用户消息mapper
 * @author: yzc
 * @date: 2023-06-09 11:08
 */
@Mapper
public interface KwmMessageUserMapper extends BaseMapper<KwmMessageUser> {

    /**
     * @desc: 批量插入
     * @author: yzc
     * @date: 2023-06-26 12:02
     * @Param messageUsers:
     * @return: void
     */
    void insertBatch(@Param(value = "list") List<KwmMessageUser> list);

    /**
     * @desc: 根据用户或企业，状态升序，type分组统计消息数量，查找前五条
     * @author: yzc
     * @date: 2023-09-07 15:38
     * @Param item:
     * @return: java.util.List<com.sckw.message.model.vo.res.UserCenterMsgVO>
     */
    List<UserCenterMsgVO> userMsgCenter(@Param(value = "item") UserMsgCenterReqDTO item);

    /**
     * @desc: 获取用户最新消息
     * @author: yzc
     * @date: 2023-09-07 17:43
     * @Param item:
     * @return: com.sckw.message.model.dto.UserMsgCenterLatestMsgDTO
     */
    UserMsgCenterLatestMsgDTO getLatestMsg(@Param(value = "item") UserMsgCenterReqDTO item);
}
