package cn.newfeifan.mall.module.trade.dal.mysql.jpushmessagelog;


import cn.newfeifan.mall.framework.common.pojo.PageResult;
import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
import cn.newfeifan.mall.module.trade.dal.dataobject.jpushmessagelog.JPushMessageLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.trade.controller.admin.jpushmessagelog.vo.*;

/**
 * 极光推送记录 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface JPushMessageLogMapper extends BaseMapperX<JPushMessageLogDO> {

    default PageResult<JPushMessageLogDO> selectPage(JPushMessageLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JPushMessageLogDO>()
                .eqIfPresent(JPushMessageLogDO::getRegId, reqVO.getRegId())
                .eqIfPresent(JPushMessageLogDO::getMemberUserId, reqVO.getMemberUserId())
                .eqIfPresent(JPushMessageLogDO::getSystemUserId, reqVO.getSystemUserId())
                .eqIfPresent(JPushMessageLogDO::getJpushParams, reqVO.getJpushParams())
                .eqIfPresent(JPushMessageLogDO::getObjectId, reqVO.getObjectId())
                .betweenIfPresent(JPushMessageLogDO::getSendTime, reqVO.getSendTime())
                .eqIfPresent(JPushMessageLogDO::getResponseResult, reqVO.getResponseResult())
                .betweenIfPresent(JPushMessageLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(JPushMessageLogDO::getId));
    }

}