package cn.iocoder.yudao.module.mes.dal.mysql.moldrepairtems;

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.mes.dal.dataobject.moldrepairtems.MoldRepairTemsDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 维修项目 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface MoldRepairTemsMapper extends BaseMapperX<MoldRepairTemsDO> {

    default PageResult<MoldRepairTemsDO> selectPage(MoldRepairTemsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoldRepairTemsDO>()
                .eqIfPresent(MoldRepairTemsDO::getSubjectCode, reqVO.getSubjectCode())
                .likeIfPresent(MoldRepairTemsDO::getSubjectName, reqVO.getSubjectName())
                .eqIfPresent(MoldRepairTemsDO::getMoldBrand, reqVO.getMoldBrand())
                .eqIfPresent(MoldRepairTemsDO::getMoldId, reqVO.getMoldId())
                .eqIfPresent(MoldRepairTemsDO::getComponentId, reqVO.getComponentId())
                .eqIfPresent(MoldRepairTemsDO::getInspectionMethod, reqVO.getInspectionMethod())
                .eqIfPresent(MoldRepairTemsDO::getValueType, reqVO.getValueType())
                .eqIfPresent(MoldRepairTemsDO::getJudgmentCriteria, reqVO.getJudgmentCriteria())
                .eqIfPresent(MoldRepairTemsDO::getIsEnable, reqVO.getIsEnable())
                .betweenIfPresent(MoldRepairTemsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoldRepairTemsDO::getId));
    }

    IPage<MoldRepairTemsRespVO> getMoldRepairTemsPage(Page<MoldRepairTemsRespVO> page,  @Param("pageReqVO") MoldRepairTemsPageReqVO pageReqVO);

    List<MoldRepairTemsRespVO> getMoldRepairTemsList( @Param("pageReqVO") MoldRepairTemsPageReqVO pageReqVO);

}