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

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.zjproductrecord.ZjProductRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.zjproductrecord.vo.*;

/**
 * 试产质检记录 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface ZjProductRecordMapper extends BaseMapperX<ZjProductRecordDO> {

    default PageResult<ZjProductRecordDO> selectPage(ZjProductRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ZjProductRecordDO>()
                .eqIfPresent(ZjProductRecordDO::getType, reqVO.getType())
                .likeIfPresent(ZjProductRecordDO::getName, reqVO.getName())
                .eqIfPresent(ZjProductRecordDO::getUnit, reqVO.getUnit())
                .eqIfPresent(ZjProductRecordDO::getUpperVal, reqVO.getUpperVal())
                .eqIfPresent(ZjProductRecordDO::getLowerVal, reqVO.getLowerVal())
                .eqIfPresent(ZjProductRecordDO::getProductId, reqVO.getProductId())
                .eqIfPresent(ZjProductRecordDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ZjProductRecordDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ZjProductRecordDO::getPlanId, reqVO.getPlanId())
                .orderByDesc(ZjProductRecordDO::getId));
    }

}