package cn.iocoder.yudao.module.pms.dal.mysql.maintain;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pms.controller.admin.maintain.bom.vo.IotMaintainBomPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainBomDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 维修工单对应维修项BOM Mapper
 *
 * @author 李鹏辉
 */
@Mapper
public interface IotMaintainBomMapper extends BaseMapperX<IotMaintainBomDO> {

    default PageResult<IotMaintainBomDO> selectPage(IotMaintainBomPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotMaintainBomDO>()
                .eqIfPresent(IotMaintainBomDO::getMaintainId, reqVO.getMaintainId())
                .eqIfPresent(IotMaintainBomDO::getBomNodeId, reqVO.getBomNodeId())
                .likeIfPresent(IotMaintainBomDO::getName, reqVO.getName())
                .eqIfPresent(IotMaintainBomDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(IotMaintainBomDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotMaintainBomDO::getId));
    }

}
