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


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.ordercallbacklogs.OrderCallbackLogsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.trade.controller.admin.ordercallbacklogs.vo.*;

/**
 * 第三方回调日志 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface OrderCallbackLogsMapper extends BaseMapperX<OrderCallbackLogsDO> {

    default PageResult<OrderCallbackLogsDO> selectPage(OrderCallbackLogsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderCallbackLogsDO>()
                .eqIfPresent(OrderCallbackLogsDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(OrderCallbackLogsDO::getRequestParam, reqVO.getRequestParam())
                .eqIfPresent(OrderCallbackLogsDO::getResponseBody, reqVO.getResponseBody())
                .eqIfPresent(OrderCallbackLogsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(OrderCallbackLogsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderCallbackLogsDO::getId));
    }

}