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

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.depotlocation.DepotLocationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.depotlocation.vo.*;

/**
 * 库位管理 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface DepotLocationMapper extends BaseMapperX<DepotLocationDO> {

    default PageResult<DepotLocationDO> selectPage(DepotLocationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DepotLocationDO>()
                .eqIfPresent(DepotLocationDO::getFactoryId, reqVO.getFactoryId())
                .eqIfPresent(DepotLocationDO::getDepotId, reqVO.getDepotId())
                .eqIfPresent(DepotLocationDO::getDepotAreaId, reqVO.getDepotAreaId())
                .eqIfPresent(DepotLocationDO::getRowNum, reqVO.getRowNum())
                .eqIfPresent(DepotLocationDO::getColumnNum, reqVO.getColumnNum())
                .eqIfPresent(DepotLocationDO::getLayerNum, reqVO.getLayerNum())
                .betweenIfPresent(DepotLocationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DepotLocationDO::getId));
    }

}
