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

import java.util.*;

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.BusinessSampleAssayResultPageReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayResultDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 委检登记来样品位 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface BusinessSampleAssayResultMapper extends BaseMapperX<BusinessSampleAssayResultDO> {

    default PageResult<BusinessSampleAssayResultDO> selectPage(BusinessSampleAssayResultPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSampleAssayResultDO>()
                .eqIfPresent(BusinessSampleAssayResultDO::getBusinessSampleEntrustDetailId, reqVO.getBusinessSampleEntrustDetailId())
                .eqIfPresent(BusinessSampleAssayResultDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
                .eqIfPresent(BusinessSampleAssayResultDO::getData, reqVO.getData())
                .eqIfPresent(BusinessSampleAssayResultDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessSampleAssayResultDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessSampleAssayResultDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessSampleAssayResultDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessSampleAssayResultDO::getId));
    }

    /**
     * 物理批量删除删除
     * @param idList
     * @return
     */
    int physicalDeleteByIds(@Param("idList") List<Long> idList);

}