package com.cdm.module.pay.dal.mysql.app;

import com.cdm.framework.common.pojo.PageResult;
import com.cdm.framework.mybatis.core.mapper.BaseMapperX;
import com.cdm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cdm.framework.mybatis.core.query.QueryWrapperX;
import com.cdm.module.pay.controller.admin.app.vo.PayAppPageReqVO;
import com.cdm.module.pay.dal.dataobject.app.PayAppDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface PayAppMapper extends BaseMapperX<PayAppDO> {

    default PageResult<PayAppDO> selectPage(PayAppPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayAppDO>()
                .likeIfPresent(PayAppDO::getName, reqVO.getName())
                .eqIfPresent(PayAppDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayAppDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayAppDO::getId));
    }

}
