package com.zt.plat.module.erp.dal.mysql.erp;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpProcessDetailPageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpProcessDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * ERP工艺路线明细 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ErpProcessDetailMapper extends BaseMapperX<ErpProcessDetailDO> {

    default PageResult<ErpProcessDetailDO> selectPage(ErpProcessDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDetailDO>()
                .eqIfPresent(ErpProcessDetailDO::getProcessId, reqVO.getProcessId())
                .likeIfPresent(ErpProcessDetailDO::getProcessingNumber, reqVO.getProcessingNumber())
                .likeIfPresent(ErpProcessDetailDO::getProcessingName, reqVO.getProcessingName())
                .eqIfPresent(ErpProcessDetailDO::getUom, reqVO.getUom())
                .likeIfPresent(ErpProcessDetailDO::getWorkCenterNumber, reqVO.getWorkCenterNumber())
                .likeIfPresent(ErpProcessDetailDO::getWorkCenterName, reqVO.getWorkCenterName())
                .orderByDesc(ErpProcessDetailDO::getId));
    }

}