package cn.iocoder.yudao.module.mes.dal.mysql.dv.borrow;
|
|
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.dv.borrow.vo.MesDvBorrowPageReqVO;
|
import cn.iocoder.yudao.module.mes.dal.dataobject.dv.borrow.MesDvBorrowDO;
|
import org.apache.ibatis.annotations.Mapper;
|
|
/**
|
* MES 设备借用归还 Mapper
|
*
|
* @author 超级管理员
|
*/
|
@Mapper
|
public interface MesDvBorrowMapper extends BaseMapperX<MesDvBorrowDO> {
|
|
default PageResult<MesDvBorrowDO> selectPage(MesDvBorrowPageReqVO reqVO) {
|
return selectPage(reqVO, new LambdaQueryWrapperX<MesDvBorrowDO>()
|
.likeIfPresent(MesDvBorrowDO::getCode, reqVO.getCode())
|
.eqIfPresent(MesDvBorrowDO::getMachineryId, reqVO.getMachineryId())
|
.eqIfPresent(MesDvBorrowDO::getBorrowerUserId, reqVO.getBorrowerUserId())
|
.eqIfPresent(MesDvBorrowDO::getStatus, reqVO.getStatus())
|
.betweenIfPresent(MesDvBorrowDO::getBorrowTime, reqVO.getBorrowTime())
|
.orderByDesc(MesDvBorrowDO::getId));
|
}
|
|
default MesDvBorrowDO selectByCode(String code) {
|
return selectOne(MesDvBorrowDO::getCode, code);
|
}
|
|
default Long selectCountByMachineryIdAndStatus(Long machineryId, Integer status) {
|
return selectCount(new LambdaQueryWrapperX<MesDvBorrowDO>()
|
.eq(MesDvBorrowDO::getMachineryId, machineryId)
|
.eq(MesDvBorrowDO::getStatus, status));
|
}
|
|
}
|