package cn.iocoder.yudao.module.system.dal.mysql.biz;

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.system.controller.admin.biz.vo.WarehouseConfigPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.WarehouseConfigDO;
import org.apache.ibatis.annotations.Mapper;


@Mapper
public interface WarehouseConfigMapper extends BaseMapperX<WarehouseConfigDO>{

    default PageResult<WarehouseConfigDO> selectPage(WarehouseConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseConfigDO>()
                .likeIfPresent(WarehouseConfigDO::getName, reqVO.getName())
                .eqIfPresent(WarehouseConfigDO::getLocation, reqVO.getLocation())
                .eqIfPresent(WarehouseConfigDO::getArea, reqVO.getArea())
                .eqIfPresent(WarehouseConfigDO::getManager, reqVO.getManager())
                .eqIfPresent(WarehouseConfigDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(WarehouseConfigDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(WarehouseConfigDO::getOrgType, reqVO.getOrgType())
                .inIfPresent(WarehouseConfigDO::getTenantId, reqVO.getTenantIds())
                .orderByDesc(WarehouseConfigDO::getId));
    }

}
