|
|
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.erp.dal.mysql.pallet;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.pallet.enums.ErpPalletStatusEnum;
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.pallet.vo.ErpPalletPageReqVO;
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.pallet.vo.ErpPalletPageReqVO;
|
|
|
|
import cn.iocoder.yudao.module.erp.dal.dataobject.pallet.ErpPalletDO;
|
|
|
|
import cn.iocoder.yudao.module.erp.dal.dataobject.pallet.ErpPalletDO;
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
@ -16,19 +17,29 @@ import java.util.List;
|
|
|
|
public interface ErpPalletMapper extends BaseMapperX<ErpPalletDO> {
|
|
|
|
public interface ErpPalletMapper extends BaseMapperX<ErpPalletDO> {
|
|
|
|
|
|
|
|
|
|
|
|
default PageResult<ErpPalletDO> selectPage(ErpPalletPageReqVO reqVO) {
|
|
|
|
default PageResult<ErpPalletDO> selectPage(ErpPalletPageReqVO reqVO) {
|
|
|
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpPalletDO>()
|
|
|
|
LambdaQueryWrapperX<ErpPalletDO> query = new LambdaQueryWrapperX<ErpPalletDO>()
|
|
|
|
.likeIfPresent(ErpPalletDO::getCode, reqVO.getCode())
|
|
|
|
.likeIfPresent(ErpPalletDO::getCode, reqVO.getCode())
|
|
|
|
.eqIfPresent(ErpPalletDO::getPalletType, reqVO.getPalletType())
|
|
|
|
.eqIfPresent(ErpPalletDO::getPalletType, reqVO.getPalletType())
|
|
|
|
.eqIfPresent(ErpPalletDO::getStatus, reqVO.getStatus())
|
|
|
|
|
|
|
|
.neIfPresent(ErpPalletDO::getStatus, reqVO.getExcludeStatus())
|
|
|
|
|
|
|
|
.eqIfPresent(ErpPalletDO::getWarehouseId, reqVO.getWarehouseId())
|
|
|
|
.eqIfPresent(ErpPalletDO::getWarehouseId, reqVO.getWarehouseId())
|
|
|
|
.eqIfPresent(ErpPalletDO::getAreaId, reqVO.getAreaId())
|
|
|
|
.eqIfPresent(ErpPalletDO::getAreaId, reqVO.getAreaId())
|
|
|
|
.likeIfPresent(ErpPalletDO::getPlanCode, reqVO.getPlanCode())
|
|
|
|
.likeIfPresent(ErpPalletDO::getPlanCode, reqVO.getPlanCode())
|
|
|
|
.eqIfPresent(ErpPalletDO::getProductId, reqVO.getProductId())
|
|
|
|
|
|
|
|
.betweenIfPresent(ErpPalletDO::getPurchaseDate, reqVO.getPurchaseDate())
|
|
|
|
.betweenIfPresent(ErpPalletDO::getPurchaseDate, reqVO.getPurchaseDate())
|
|
|
|
.betweenIfPresent(ErpPalletDO::getUseDate, reqVO.getUseDate())
|
|
|
|
.betweenIfPresent(ErpPalletDO::getUseDate, reqVO.getUseDate())
|
|
|
|
.betweenIfPresent(ErpPalletDO::getCreateTime, reqVO.getCreateTime())
|
|
|
|
.betweenIfPresent(ErpPalletDO::getCreateTime, reqVO.getCreateTime())
|
|
|
|
.orderByDesc(ErpPalletDO::getId));
|
|
|
|
.orderByDesc(ErpPalletDO::getId);
|
|
|
|
|
|
|
|
if (reqVO.getProductId() != null && reqVO.getExcludeStatus() != null && reqVO.getStatus() == null) {
|
|
|
|
|
|
|
|
query.and(wrapper -> wrapper
|
|
|
|
|
|
|
|
.and(productWrapper -> productWrapper
|
|
|
|
|
|
|
|
.eq(ErpPalletDO::getProductId, reqVO.getProductId())
|
|
|
|
|
|
|
|
.ne(ErpPalletDO::getStatus, reqVO.getExcludeStatus()))
|
|
|
|
|
|
|
|
.or()
|
|
|
|
|
|
|
|
.eq(ErpPalletDO::getStatus, ErpPalletStatusEnum.IDLE.getStatus()));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
query.eqIfPresent(ErpPalletDO::getStatus, reqVO.getStatus())
|
|
|
|
|
|
|
|
.neIfPresent(ErpPalletDO::getStatus, reqVO.getExcludeStatus())
|
|
|
|
|
|
|
|
.eqIfPresent(ErpPalletDO::getProductId, reqVO.getProductId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return selectPage(reqVO, query);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default ErpPalletDO selectByCode(String code) {
|
|
|
|
default ErpPalletDO selectByCode(String code) {
|
|
|
|
|