package com.sqx.modules.gameChat.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.sqx.modules.gameChat.entity.ChatContentTcwm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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


@Mapper
public interface ChatContentTcwmDao extends BaseMapper<ChatContentTcwm> {

    IPage<Map<String,Object>> selectChatContentPage(Page<Map<String,Object>> page,@Param("chatConversationId") Long chatConversationId,@Param("content") String content);

    int updateChatContentStatusByUserIdAndChatId(@Param("userId") Long userId,@Param("chatConversationId") Long chatConversationId);

    int selectChatCount(@Param("userId") Long userId);

    List<Map<String,Object>> selectChatContentCountByWx(@Param("minute") Integer minute,@Param("counts") Integer counts);

    List<Map<String,Object>> selectChatContentCountByDx(@Param("minute") Integer minute,@Param("counts") Integer counts);

    IPage<ChatContentTcwm> selectOrdersChatPage(Page<ChatContentTcwm> pages, Long userId, Long riderId, Long shopId);

    IPage<ChatContentTcwm> selectOrdersChatList(Page<ChatContentTcwm> pages,String userName);

    IPage<ChatContentTcwm> selectGameChatDetails(Page<ChatContentTcwm> pages, Long ordersId);

    IPage<ChatContentTcwm> selectGameChatList(Page<ChatContentTcwm> pages, String userName,String content,Long ordersId);

    int selectUnreadCount(Long ordersId, Integer i);

    int selectUnreadMessage(Long ordersId, Integer type);

    int updateRead(Long ordersId, Integer type);

    int selectAllUnreadCount(Long userId, Long riderUserId, Long shopId);

    int updateShopAllUnreadCount(Long userId, Long riderUserId, Long shopId);

}