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.ConfigSubSampleMethodPageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 子样与检测方法配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSampleMethodDO> {

    default PageResult<ConfigSubSampleMethodDO> selectPage(ConfigSubSampleMethodPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSubSampleMethodDO>()
                .eqIfPresent(ConfigSubSampleMethodDO::getConfigSubSampleId, reqVO.getConfigSubSampleId())
                .eqIfPresent(ConfigSubSampleMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
                .eqIfPresent(ConfigSubSampleMethodDO::getIsDefaultUse, reqVO.getIsDefaultUse())
                .eqIfPresent(ConfigSubSampleMethodDO::getTaskCount, reqVO.getTaskCount())
                .eqIfPresent(ConfigSubSampleMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigSubSampleMethodDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigSubSampleMethodDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigSubSampleMethodDO::getId));
    }

}