package com.zt.plat.module.qms.business.config.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationInfomationPageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationInfomationDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.qms.business.config.controller.vo.*;

/**
 * 样品库位信息 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigWarehouseLocationInfomationMapper extends BaseMapperX<ConfigWarehouseLocationInfomationDO> {

    default PageResult<ConfigWarehouseLocationInfomationDO> selectPage(ConfigWarehouseLocationInfomationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigWarehouseLocationInfomationDO>()
                .likeIfPresent(ConfigWarehouseLocationInfomationDO::getName, reqVO.getName())
                .eqIfPresent(ConfigWarehouseLocationInfomationDO::getCode, reqVO.getCode())
                .eqIfPresent(ConfigWarehouseLocationInfomationDO::getWarehouseCoding, reqVO.getWarehouseCoding())
                .eqIfPresent(ConfigWarehouseLocationInfomationDO::getCapacity, reqVO.getCapacity())
                .eqIfPresent(ConfigWarehouseLocationInfomationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigWarehouseLocationInfomationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigWarehouseLocationInfomationDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigWarehouseLocationInfomationDO::getId));
    }

}