package cn.iocoder.yudao.module.pms.dal.mysql.qhse.measure;

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.qhse.measure.vo.IotMeasureDetectPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.measure.IotMeasureDetectDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 计量器具-检测校准明细 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface IotMeasureDetectMapper extends BaseMapperX<IotMeasureDetectDO> {

    default PageResult<IotMeasureDetectDO> selectPage(IotMeasureDetectPageReqVO reqVO, Set<Long> ids) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotMeasureDetectDO>()
                .eqIfPresent(IotMeasureDetectDO::getMeasureId, reqVO.getMeasureId())
                .betweenIfPresent(IotMeasureDetectDO::getDetectDate, reqVO.getDetectDate())
                .eqIfPresent(IotMeasureDetectDO::getDetectOrg, reqVO.getDetectOrg())
                .eqIfPresent(IotMeasureDetectDO::getDetectContent, reqVO.getDetectContent())
                .eqIfPresent(IotMeasureDetectDO::getValidityPeriod, reqVO.getValidityPeriod())
                .eqIfPresent(IotMeasureDetectDO::getDetectAmount, reqVO.getDetectAmount())
                .betweenIfPresent(IotMeasureDetectDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(IotMeasureDetectDO::getMeasureCertNo, reqVO.getMeasureCertNo())
                .likeIfPresent(IotMeasureDetectDO::getDetectStandard, reqVO.getDetectStandard())
                .inIfPresent(IotMeasureDetectDO::getDeptId, ids)
                .orderByDesc(IotMeasureDetectDO::getId));
    }

}