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

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.controller.admin.depot.vo.DepotPageReqVO;
import cn.iocoder.yudao.module.wms.controller.admin.depot.vo.DepotRespVO;
import cn.iocoder.yudao.module.wms.dal.dataobject.depotarea.DepotAreaDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.depotarea.vo.*;

/**
 * 库区管理 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface DepotAreaMapper extends BaseMapperX<DepotAreaDO> {

    default PageResult<DepotAreaDO> selectPage(DepotAreaPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DepotAreaDO>()
                .eqIfPresent(DepotAreaDO::getFactoryId, reqVO.getFactoryId())
                .eqIfPresent(DepotAreaDO::getDepotId, reqVO.getDepotId())
                .likeIfPresent(DepotAreaDO::getDepotAreaName, reqVO.getDepotAreaName())
                .eqIfPresent(DepotAreaDO::getDepotAreaType, reqVO.getDepotAreaType())
                .eqIfPresent(DepotAreaDO::getStatus, reqVO.getStatus())
                .eqIfPresent(DepotAreaDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DepotAreaDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DepotAreaDO::getId));
    }

    List<DepotAreaRespVO> getDepotAreaAllList(DepotAreaPageReqVO pageReqVO);
}
