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

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

/**
 * 库位子表管理 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface DepotLocationItemMapper extends BaseMapperX<DepotLocationItemDO> {

    default PageResult<DepotLocationItemDO> selectPage(DepotLocationItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DepotLocationItemDO>()
                .eqIfPresent(DepotLocationItemDO::getLocationId, reqVO.getLocationId())
                .eqIfPresent(DepotLocationItemDO::getColumnNum, reqVO.getColumnNum())
                .eqIfPresent(DepotLocationItemDO::getRowNum, reqVO.getRowNum())
                .eqIfPresent(DepotLocationItemDO::getTop, reqVO.getTop())
                .eqIfPresent(DepotLocationItemDO::getBottom, reqVO.getBottom())
                .eqIfPresent(DepotLocationItemDO::getLeft, reqVO.getLeft())
                .eqIfPresent(DepotLocationItemDO::getRight, reqVO.getRight())
                .eqIfPresent(DepotLocationItemDO::getCoordinate, reqVO.getCoordinate())
                .betweenIfPresent(DepotLocationItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DepotLocationItemDO::getId));
    }

}