package com.zt.plat.module.base.dal.dao.internalsupplyfactory;

import java.util.*;

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.base.controller.admin.internalsupplyfactory.vo.InternalSupplyFactoryPageReqVO;
import com.zt.plat.module.base.dal.dataobject.internalsupplyfactory.InternalSupplyFactoryDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 供应链内部工厂 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface InternalSupplyFactoryMapper extends BaseMapperX<InternalSupplyFactoryDO> {

    default PageResult<InternalSupplyFactoryDO> selectPage(InternalSupplyFactoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InternalSupplyFactoryDO>()
                .likeIfPresent(InternalSupplyFactoryDO::getCompanyIdCustom, reqVO.getCompanyIdCustom())
                .likeIfPresent(InternalSupplyFactoryDO::getCompanyNameCustom, reqVO.getCompanyNameCustom())
                .likeIfPresent(InternalSupplyFactoryDO::getName, reqVO.getName())
                .likeIfPresent(InternalSupplyFactoryDO::getNumber, reqVO.getNumber())
                .eqIfPresent(InternalSupplyFactoryDO::getType, reqVO.getType())
                .likeIfPresent(InternalSupplyFactoryDO::getRelativityName, reqVO.getRelativityName())
                .eqIfPresent(InternalSupplyFactoryDO::getRelativityNumber, reqVO.getRelativityNumber())
                .eqIfPresent(InternalSupplyFactoryDO::getIsEnable, reqVO.getIsEnable())
                .betweenIfPresent(InternalSupplyFactoryDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(InternalSupplyFactoryDO::getOperationType, reqVO.getOperationType())
                .orderByDesc(InternalSupplyFactoryDO::getId));
    }

}