/*
 * Author: wangjian
 * 生成mapper
 */
package com.tofly.base.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.base.entity.dto.MessagepushDto;
import com.tofly.base.vo.MessagepushVo;
import com.tofly.pojo.message.Messagepush;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 消息推送数据表:TF_YWPN_MESSAGEPUSH_W
 *
 * @author admin
 * @date Wed Mar 31 00:00:00 CST 2021
 */
public interface MessagepushMapper extends BaseMapper<Messagepush> {
    @Select("select  p.ID id, p.TOPIC topic, p.MESSAGE message, p.REPLY_ID replyId ,p.TYPE type,p.TABLE_NAME tableName,p.TABLE_ID tableId, " +
            "p.ROUTE_IP routeIp,p.ROUTE_IP_APP routeIpApp,p.CREATE_TIME createTime,t.FLAG flag,t.RECIPIENT recipient " +
            "from TF_YWPN_MESSAGEPUSH_W p LEFT JOIN TF_YWPN_MESSAGERECIPIENT_W t on p.ID = t.MESSAGE_ID " +
            "${ew.customSqlSegment} " +
            "order by createTime DESC")
    Page<MessagepushVo> searchWeeklyPage(Page<MessagepushVo> page, @Param(Constants.WRAPPER) QueryWrapper<MessagepushDto> queryWrapper);
}
