package cn.iocoder.yudao.module.pms.dal.mysql.qhse.emergency;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pms.controller.admin.qhse.emergency.vo.QhseEmergencyCertPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.emergency.QhseEmergencyCertDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * QHSE应急物资检测证书 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface QhseEmergencyCertMapper extends BaseMapperX<QhseEmergencyCertDO> {

    default PageResult<QhseEmergencyCertDO> selectPage(QhseEmergencyCertPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QhseEmergencyCertDO>()
                .eqIfPresent(QhseEmergencyCertDO::getEmergencyId, reqVO.getEmergencyId())
                .eqIfPresent(QhseEmergencyCertDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(QhseEmergencyCertDO::getEmergencyName, reqVO.getEmergencyName())
                .eqIfPresent(QhseEmergencyCertDO::getCertNo, reqVO.getCertNo())
                .eqIfPresent(QhseEmergencyCertDO::getCertOrg, reqVO.getCertOrg())
                .betweenIfPresent(QhseEmergencyCertDO::getCertTime, reqVO.getCertTime())
                .eqIfPresent(QhseEmergencyCertDO::getCertExpire, reqVO.getCertExpire())
                .eqIfPresent(QhseEmergencyCertDO::getFile, reqVO.getFile())
                .eqIfPresent(QhseEmergencyCertDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(QhseEmergencyCertDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(QhseEmergencyCertDO::getDeptName, reqVO.getDeptName())
                .orderByDesc(QhseEmergencyCertDO::getId));
    }

}