package cn.iocoder.yudao.module.wms.dal.mysql.businessordernumber;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wms.dal.dataobject.businessordernumber.BusinessOrderNumberDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.businessordernumber.vo.*;

/**
 * 业务单号管理 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface BusinessOrderNumberMapper extends BaseMapperX<BusinessOrderNumberDO> {

    default PageResult<BusinessOrderNumberDO> selectPage(BusinessOrderNumberPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessOrderNumberDO>()
                .likeIfPresent(BusinessOrderNumberDO::getName, reqVO.getName())
                .eqIfPresent(BusinessOrderNumberDO::getPrefixCode, reqVO.getPrefixCode())
                .eqIfPresent(BusinessOrderNumberDO::getTimeRule, reqVO.getTimeRule())
                .eqIfPresent(BusinessOrderNumberDO::getOrderNoLength, reqVO.getOrderNoLength())
                .eqIfPresent(BusinessOrderNumberDO::getOrderNoRule, reqVO.getOrderNoRule())
                .eqIfPresent(BusinessOrderNumberDO::getStatus, reqVO.getStatus())
                .eqIfPresent(BusinessOrderNumberDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(BusinessOrderNumberDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BusinessOrderNumberDO::getId));
    }

}