package com.zt.plat.module.qms.resource.material.dal.mapper;

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.qms.resource.material.controller.vo.MaterialUseRecordDetailPageReqVO;
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialUseRecordDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 使用记录配置关系,用于处理危险品溶液配置关系 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface MaterialUseRecordDetailMapper extends BaseMapperX<MaterialUseRecordDetailDO> {

    default PageResult<MaterialUseRecordDetailDO> selectPage(MaterialUseRecordDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaterialUseRecordDetailDO>()
                .eqIfPresent(MaterialUseRecordDetailDO::getInfomationId, reqVO.getInfomationId())
                .eqIfPresent(MaterialUseRecordDetailDO::getRecordId, reqVO.getRecordId())
                .eqIfPresent(MaterialUseRecordDetailDO::getTargetInfomationId, reqVO.getTargetInfomationId())
                .eqIfPresent(MaterialUseRecordDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(MaterialUseRecordDetailDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(MaterialUseRecordDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MaterialUseRecordDetailDO::getId));
    }

}