package com.zt.plat.module.qms.business.config.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.config.controller.vo.*;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverPageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleHandoverDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 样品交接单配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigSampleHandoverMapper extends BaseMapperX<ConfigSampleHandoverDO> {

    default PageResult<ConfigSampleHandoverDO> selectPage(ConfigSampleHandoverPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSampleHandoverDO>()
                .likeIfPresent(ConfigSampleHandoverDO::getName, reqVO.getName())
                .eqIfPresent(ConfigSampleHandoverDO::getDictionarySampleFlowNodeKey, reqVO.getDictionarySampleFlowNodeKey())
                .eqIfPresent(ConfigSampleHandoverDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey())
                .eqIfPresent(ConfigSampleHandoverDO::getCodeRule, reqVO.getCodeRule())
                .eqIfPresent(ConfigSampleHandoverDO::getIsPrint, reqVO.getIsPrint())
                .eqIfPresent(ConfigSampleHandoverDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigSampleHandoverDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigSampleHandoverDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigSampleHandoverDO::getId));
    }

}