package cn.iocoder.yudao.module.mes.dal.mysql.pro.pallet;
|
|
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;
|
import cn.iocoder.yudao.module.mes.controller.admin.pro.pallet.vo.MesProPalletPageReqVO;
|
import cn.iocoder.yudao.module.mes.dal.dataobject.pro.pallet.MesProPalletDO;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.util.List;
|
|
/**
|
* MES 托盘码 Mapper
|
*
|
* @author 超级管理员
|
*/
|
@Mapper
|
public interface MesProPalletMapper extends BaseMapperX<MesProPalletDO> {
|
|
default MesProPalletDO selectByCode(String code) {
|
return selectOne(MesProPalletDO::getCode, code);
|
}
|
|
default List<MesProPalletDO> selectListByBatchId(Long batchId) {
|
return selectList(MesProPalletDO::getBatchId, batchId);
|
}
|
|
default PageResult<MesProPalletDO> selectPage(MesProPalletPageReqVO reqVO) {
|
return selectPage(reqVO, new LambdaQueryWrapperX<MesProPalletDO>()
|
.likeIfPresent(MesProPalletDO::getCode, reqVO.getCode())
|
.eqIfPresent(MesProPalletDO::getBatchId, reqVO.getBatchId())
|
.likeIfPresent(MesProPalletDO::getBatchCode, reqVO.getBatchCode())
|
.eqIfPresent(MesProPalletDO::getStatus, reqVO.getStatus())
|
.betweenIfPresent(MesProPalletDO::getCreateTime, reqVO.getCreateTime())
|
.orderByDesc(MesProPalletDO::getId));
|
}
|
|
/**
|
* 查询批次内托盘最大序号(包含已逻辑删除记录,保证序号不回退、码值唯一)
|
*
|
* @param batchId 批次编号
|
* @return 最大托盘序号,无记录返回 0
|
*/
|
@Select("SELECT IFNULL(MAX(pallet_no), 0) FROM mes_pro_pallet WHERE batch_id = #{batchId}")
|
Integer selectMaxPalletNo(@Param("batchId") Long batchId);
|
|
}
|