package cn.iocoder.yudao.module.server.dal.mysql.harmfulinforeport;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.server.dal.dataobject.harmfulinforeport.HarmfulInfoReportDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.server.controller.admin.harmfulinforeport.vo.*;

/**
 * 信息上报 Mapper
 *
 * @author TRS
 */
@Mapper
public interface HarmfulInfoReportMapper extends BaseMapperX<HarmfulInfoReportDO> {

    default PageResult<HarmfulInfoReportDO> selectPage(HarmfulInfoReportPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HarmfulInfoReportDO>()
                .eqIfPresent(HarmfulInfoReportDO::getWebsite, reqVO.getWebsite())
                .eqIfPresent(HarmfulInfoReportDO::getNewMedia, reqVO.getNewMedia())
                .eqIfPresent(HarmfulInfoReportDO::getInternalNetwork, reqVO.getInternalNetwork())
                .eqIfPresent(HarmfulInfoReportDO::getTotalCount, reqVO.getTotalCount())
                .eqIfPresent(HarmfulInfoReportDO::getQuarter, reqVO.getQuarter())
                .eqIfPresent(HarmfulInfoReportDO::getReporterName, reqVO.getReporterName())
                .eqIfPresent(HarmfulInfoReportDO::getReporterType, reqVO.getReporterType())
                .eqIfPresent(HarmfulInfoReportDO::getReporterPhone, reqVO.getReporterPhone())
                .betweenIfPresent(HarmfulInfoReportDO::getReportTime, reqVO.getReportTime())
                .eqIfPresent(HarmfulInfoReportDO::getDepartmentId, reqVO.getDepartmentId())
                .likeIfPresent(HarmfulInfoReportDO::getDepartmentName, reqVO.getDepartmentName())
                .eqIfPresent(HarmfulInfoReportDO::getReportStatus, reqVO.getReportStatus())
                .eqIfPresent(HarmfulInfoReportDO::getReportRemark, reqVO.getReportRemark())
                .orderByDesc(HarmfulInfoReportDO::getId));
    }

}