package cn.newfeifan.mall.sale.dal.mysql.merchantapplylog;

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.sale.dal.dataobject.merchantapplylog.MerchantApplyLogDO;
import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 商户审核记录 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface MerchantApplyLogMapper extends BaseMapperX<MerchantApplyLogDO> {

    default PageResult<MerchantApplyLogDO> selectPage(MerchantApplyLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MerchantApplyLogDO>()
                .eqIfPresent(MerchantApplyLogDO::getStatus, reqVO.getStatus())
                .eqIfPresent(MerchantApplyLogDO::getMerchantApplyId, reqVO.getMerchantApplyId())
                .eqIfPresent(MerchantApplyLogDO::getCheckSystemUserId, reqVO.getCheckSystemUserId())
                .eqIfPresent(MerchantApplyLogDO::getCheckComment, reqVO.getCheckComment())
                .betweenIfPresent(MerchantApplyLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MerchantApplyLogDO::getId));
    }

}