package com.zt.plat.module.qms.business.bus.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupPageReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 子样分析班组业务 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<BusinessSubSampleAnalysisGroupDO> {

    default PageResult<BusinessSubSampleAnalysisGroupDO> selectPage(BusinessSubSampleAnalysisGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
                .likeIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiver, reqVO.getSampleReceiver())
                .betweenIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, reqVO.getSampleReceiveTime())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessSubSampleAnalysisGroupDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessSubSampleAnalysisGroupDO::getId));
    }

}