| | |
| | | package cn.iocoder.yudao.module.mes.dal.mysql.wm.productsales; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | |
| | | .orderByDesc(MesWmProductSalesDO::getId)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询(带客户权限过滤) |
| | | */ |
| | | default PageResult<MesWmProductSalesDO> selectPage(MesWmProductSalesPageReqVO reqVO, List<Long> permittedClientIds) { |
| | | LambdaQueryWrapperX<MesWmProductSalesDO> wrapper = new LambdaQueryWrapperX<MesWmProductSalesDO>() |
| | | .likeIfPresent(MesWmProductSalesDO::getCode, reqVO.getCode()) |
| | | .likeIfPresent(MesWmProductSalesDO::getName, reqVO.getName()) |
| | | .eqIfPresent(MesWmProductSalesDO::getClientId, reqVO.getClientId()) |
| | | .eqIfPresent(MesWmProductSalesDO::getStatus, reqVO.getStatus()) |
| | | .betweenIfPresent(MesWmProductSalesDO::getSalesDate, reqVO.getShipmentDate()) |
| | | .orderByDesc(MesWmProductSalesDO::getId); |
| | | if (permittedClientIds != null) { |
| | | if (CollUtil.isEmpty(permittedClientIds)) { |
| | | return PageResult.empty(); |
| | | } |
| | | wrapper.in(MesWmProductSalesDO::getClientId, permittedClientIds); |
| | | } |
| | | return selectPage(reqVO, wrapper); |
| | | } |
| | | |
| | | default MesWmProductSalesDO selectByCode(String code) { |
| | | return selectOne(MesWmProductSalesDO::getCode, code); |
| | | } |