package com.hys.app.raycoswebapi.mapper.product;

import com.hys.app.framework.context.user.AdminUserContext;
import com.hys.app.framework.database.WebPage;
import com.hys.app.framework.database.mybatisplus.base.BaseMapperX;
import com.hys.app.raycoswebapi.model.dao.product.RaycosStockDao;
import com.hys.app.raycoswebapi.model.dto.product.StockInfoDto;

public interface StockInfoMapper extends BaseMapperX<RaycosStockDao> {
    default WebPage<RaycosStockDao> selectPage(StockInfoDto params) {
        return lambdaQuery()
//                .eqIfPresent(RaycosStockDao::getCompanyId, AdminUserContext.getCompanyId())
                .eqIfPresent(RaycosStockDao::getImportTaskSeq, params.getImportTaskSeq())
                .eqIfPresent(RaycosStockDao::getOriginImportTaskSeq, params.getOriginImportTaskSeq())
                .eqIfPresent(RaycosStockDao::getSalesSkuId, params.getSalesSkuId())
                .eqIfPresent(RaycosStockDao::getSalesSkuNewId, params.getSalesSkuNewId())
                .eqIfPresent(RaycosStockDao::getStockSku, params.getStockSku())
                .likeIfPresent(RaycosStockDao::getNameCn, params.getNameCn())
                .likeIfPresent(RaycosStockDao::getNameEn, params.getNameEn())
                .eqIfPresent(RaycosStockDao::getParentCategoryId, params.getParentCategoryId())
                .eqIfPresent(RaycosStockDao::getCategoryId, params.getCategoryId())
                .eqIfPresent(RaycosStockDao::getSalePrice, params.getSalePrice())
                .eqIfPresent(RaycosStockDao::getStatus, params.getStatus())
                .eqIfPresent(RaycosStockDao::getHasBattery, params.getHasBattery())
                .eqIfPresent(RaycosStockDao::getIsTort, params.getIsTort())
                .eqIfPresent(RaycosStockDao::getHasVirtualSku, params.getHasVirtualSku())
                .eqIfPresent(RaycosStockDao::getBuyerId, params.getBuyerId())
                .eqIfPresent(RaycosStockDao::getSalesId, params.getSalesId())
                .eqIfPresent(RaycosStockDao::getDeliverId, params.getDeliverId())
                .eqIfPresent(RaycosStockDao::getArtDesignerId, params.getArtDesignerId())
                .eqIfPresent(RaycosStockDao::getDefaultCost, params.getDefaultCost())
                .eqIfPresent(RaycosStockDao::getStockQuantity, params.getStockQuantity())
                .eqIfPresent(RaycosStockDao::getForecastDaySale, params.getForecastDaySale())
                .eqIfPresent(RaycosStockDao::getShippingQuantity, params.getShippingQuantity())
                .eqIfPresent(RaycosStockDao::getShippingQuantity, params.getShippingQuantity())
                .eqIfPresent(RaycosStockDao::getWaitingQuantity, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getQuantityInterval1, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getQuantityInterval2, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getQuantityInterval3, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getQuantityInterval4, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getQuantityInterval5, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getQuantityInterval6, params.getWaitingQuantity())
                .eqIfPresent(RaycosStockDao::getIsSingleWarehouse, params.getIsSingleWarehouse())
                .eqIfPresent(RaycosStockDao::getDefaultWarehouseId, params.getDefaultWarehouseId())
                .eqIfPresent(RaycosStockDao::getDefaultStockWarehouseDetailId, params.getDefaultStockWarehouseDetailId())
                .eqIfPresent(RaycosStockDao::getDefaultGridCode, params.getDefaultGridCode())
                .eqIfPresent(RaycosStockDao::getTimeCreated, params.getTimeCreated())
                .eqIfPresent(RaycosStockDao::getTimeModify, params.getTimeModify())
                .eqIfPresent(RaycosStockDao::getPurchaseType, params.getPurchaseType())
                .eqIfPresent(RaycosStockDao::getIsCloud, params.getIsCloud())
                .eqIfPresent(RaycosStockDao::getRetailSku, params.getRetailSku())
                .eqIfPresent(RaycosStockDao::getPlatformId, params.getPlatformId())
                .eqIfPresent(RaycosStockDao::getPlatformUrl, params.getPlatformUrl())
                .eqIfPresent(RaycosStockDao::getRetailId, params.getRetailId())
                .eqIfPresent(RaycosStockDao::getLivenessType, params.getLivenessType())
                .eqIfPresent(RaycosStockDao::getIsNewType, params.getIsNewType())
                .eqIfPresent(RaycosStockDao::getIsMachining, params.getIsMachining())
                .eqIfPresent(RaycosStockDao::getUpdateDate1, params.getUpdateDate1())
                .eqIfPresent(RaycosStockDao::getUpdateDate2, params.getUpdateDate2())
                .eqIfPresent(RaycosStockDao::getStopSelltime, params.getStopSelltime())
                .eqIfPresent(RaycosStockDao::getDefaultRetailId, params.getDefaultRetailId())
                .eqIfPresent(RaycosStockDao::getCreatorId, params.getCreatorId())
                .eqIfPresent(RaycosStockDao::getPurchasePrice, params.getPurchasePrice())
                .eqIfPresent(RaycosStockDao::getProcessCost, params.getProcessCost())
                .eqIfPresent(RaycosStockDao::getShippingCost, params.getShippingCost())
                .eqIfPresent(RaycosStockDao::getParentBrandId, params.getParentBrandId())
                .eqIfPresent(RaycosStockDao::getBrandId, params.getBrandId())
                .eqIfPresent(RaycosStockDao::getIsList, params.getIsList())
                .eqIfPresent(RaycosStockDao::getLastTime, params.getLastTime())
                .eqIfPresent(RaycosStockDao::getMinPaidtime, params.getMinPaidtime())
                .eqIfPresent(RaycosStockDao::getIsSynchro, params.getIsSynchro())
                .eqIfPresent(RaycosStockDao::getThirdCategoryId, params.getThirdCategoryId())
                .eqIfPresent(RaycosStockDao::getUpdateTime, params.getUpdateTime())
                .eqIfPresent(RaycosStockDao::getStatusUpdatetime, params.getStatusUpdatetime())
                .eqIfPresent(RaycosStockDao::getAllQuantity, params.getAllQuantity())
                .eqIfPresent(RaycosStockDao::getUnshipped, params.getUnshipped())
                .eqIfPresent(RaycosStockDao::getIsActive, params.getIsActive())
                .eqIfPresent(RaycosStockDao::getLastPaidTime, params.getLastPaidTime())
                .eqIfPresent(RaycosStockDao::getLastProviderId, params.getLastProviderId())
                .eqIfPresent(RaycosStockDao::getIsOpenInvoiceManage, params.getIsOpenInvoiceManage())
                .eqIfPresent(RaycosStockDao::getForecastDailyMaterialUsage, params.getForecastDailyMaterialUsage())
                .orderByDesc(RaycosStockDao::getTimeCreated)
                .page(params);
    }

}
