package com.cf.imes.module.executor.dal.mysql.moduleitem;

import java.util.*;

import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.module.executor.dal.dataobject.moduleitem.ModuleItemDO;
import org.apache.ibatis.annotations.Mapper;
import com.cf.imes.module.executor.controller.admin.moduleitem.vo.*;

/**
 * 生产单模块明细 Mapper
 *
 * @author 晨丰科技
 */
@Mapper
public interface ModuleItemMapper extends BaseMapperX<ModuleItemDO> {

    default PageResult<ModuleItemDO> selectPage(ModuleItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ModuleItemDO>()
                .eqIfPresent(ModuleItemDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(ModuleItemDO::getRoomId, reqVO.getRoomId())
                .eqIfPresent(ModuleItemDO::getBodyId, reqVO.getBodyId())
                .eqIfPresent(ModuleItemDO::getTypeId, reqVO.getTypeId())
                .eqIfPresent(ModuleItemDO::getModuleId, reqVO.getModuleId())
                .eqIfPresent(ModuleItemDO::getItemId, reqVO.getItemId())
                .orderByDesc(ModuleItemDO::getId));
    }

}