package cn.com.ty.lift.ud.chat.mapper;


import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import  com.baomidou.mybatisplus.core.mapper.BaseMapper;

import cn.com.ty.lift.ud.chat.controller.query.ChatMsgQuery;
import cn.com.ty.lift.ud.chat.mapper.entity.ChatMsgEntity;
import cn.com.ty.lift.ud.neety.protocol.IMMessage;

/**
 * 聊天记录 -Repository
 * 
 * @author Xson
 * @date 2020-04-22
 */
public interface ChatMsgMapper extends BaseMapper<ChatMsgEntity> {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table chat_msg
     *
     * @mbggenerated Tue Apr 28 14:25:10 CST 2020
     */
    int deleteByPrimaryKey(Integer id);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table chat_msg
     *
     * @mbggenerated Tue Apr 28 14:25:10 CST 2020
     */
    int insertSelective(ChatMsgEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table chat_msg
     *
     * @mbggenerated Tue Apr 28 14:25:10 CST 2020
     */
    ChatMsgEntity selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table chat_msg
     *
     * @mbggenerated Tue Apr 28 14:25:10 CST 2020
     */
    int updateByPrimaryKeySelective(ChatMsgEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table chat_msg
     *
     * @mbggenerated Tue Apr 28 14:25:10 CST 2020
     */
    int updateByPrimaryKeyWithBLOBs(ChatMsgEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table chat_msg
     *
     * @mbggenerated Tue Apr 28 14:25:10 CST 2020
     */
    int updateByPrimaryKey(ChatMsgEntity record);
    
    List<ChatMsgEntity> selectByQuery(@Param("ew") Wrapper wrapper, @Param("page") ChatMsgQuery query);

    int countByQuery(@Param("ew") Wrapper wrapper);
    
    List<IMMessage>msgHistoryListQuery(@Param("page") ChatMsgQuery query);
    
    int countMsgHistoryList(@Param("page") ChatMsgQuery query);
}
