package com.huiju.estateagents.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huiju.estateagents.entity.TaChat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 聊天记录表 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-05-10
 */
@Mapper
public interface TaChatMapper extends BaseMapper<TaChat> {

    List<TaChat> getChatHistory(IPage<TaChat> page, @Param("from") String from, @Param("to") String to);

    List<TaChat> getChatWith(IPage<TaChat> page, @Param("person") String person);

    Integer getUnReadMessage(@Param("from") String from, @Param("to") String to);

    Integer getAllUnReadMessage(@Param("personId") String personId);
}
