

package com.lutao.cloud.oil.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lutao.cloud.common.data.datascope.CloudBaseMapper;
import com.lutao.cloud.oil.pojo.param.BaseParam;
import com.lutao.cloud.oil.pojo.param.SecurityRiskAssessmentParam;
import com.lutao.cloud.oil.pojo.param.SelectSeaPlatformFacilityParam;
import com.lutao.cloud.oil.pojo.vo.*;
import com.lutao.entity.SecurityRiskAssessment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 安全风险评估信息
 *
 * @author guoyc
 * @date 2023-07-20 10:57:59
 */
@Mapper
public interface SecurityRiskAssessmentMapper extends CloudBaseMapper<SecurityRiskAssessment> {

    /**
     * 安全风险平台情况
     *
     * @param param 参数
     * @param page       页面
     * @return {@link IPage}<{@link SecurityRiskAssessmentVO}>
     */
    IPage<SecurityRiskAssessmentVO> selectRiskAssessmentStatus(Page page, @Param("param")SecurityRiskAssessmentParam param);

    /**
     * 海洋平台（实施）总体情况
     *
     * @param page  页面
     * @param param 参数
     * @return {@link IPage}<{@link SeaPlatformFacilityVO}>
     */
    IPage<SeaPlatformFacilityVO> selectSeaPlatformFacility(Page page, @Param("param") SelectSeaPlatformFacilityParam param);



    /**
     * 问题隐患整改情况-部级督导
     *
     * @param platformId 平台id
     * @param appId      应用程序id
     * @return {@link List}<{@link ProblemRectifySupervisionVO}>
     */
    IPage<ProblemRectifySupervisionVO> selectProblemRectifySupervision(Page page,
                                                                       @Param("platformId") String platformId,
                                                                       @Param("appId") String appId,
                                                                       @Param("year") String year,
                                                                       @Param("oilGasName")String oilGasName,
                                                                       @Param("operatingCompany")String operatingCompany
    );


    /**
     * 安全风险评估时间分布
     *
     * @param platformId 平台id
     * @param appId      应用程序id
     * @return {@link SecurityRiskAssessmentTimeDistributionVO}
     */
    SecurityRiskAssessmentTimeDistributionVO selectSecurityRiskAssessmentTimeDistribution(@Param("platformId") String platformId, @Param("appId") String appId);

    /**
     * 隐患和整改情况 - 平台整改完成整治率
     * @param param param
     * @return {@link HiddenDangerRectificationVO}
     */
    HiddenDangerRectificationVO getHiddenDangerRectificationRate(@Param("param")BaseParam param);


    /**
     * 评估进度-一台一策
     *
     * @param param
     * @return {@link AssessmentReportVO}
     */
    AssessmentReportVO getAssessmentStrategy(@Param("param") BaseParam param);

    /**
     * 本年度重大隐患数
     *
     * @param param
     * @return int
     */
    int getHiddenDangerNumberNowYear(@Param("param")BaseParam param);

    /**
     * 隐患风险数量占比
     *
     * @param param param
     * @return {@link HiddenDangerNumberVO}
     */
    HiddenDangerNumberVO getHiddenDangerNumber(@Param("param")BaseParam param);

    /**
     * 形成评估报告数量
     *
     * @param param param
     * @return int
     */
    int assessmentReportNumber (@Param("param")BaseParam param);

    /**
     * 获取风险级别组
     *
     * @param param param
     * @return {@link List}<{@link RiskLevelGroupVO}>
     */
    List<RiskLevelGroupVO> getRiskLevelGroup(@Param("param")BaseParam param);

    //本年度评估数量
    int getAssessmentNumberNowYear(@Param("appId")String appId,@Param("platformId")String platformId);

    List<SecurityRiskAssessmentBarList> getSecurityRiskAssessmentBarList(@Param("param") BaseParam param);

    //本年度安全风险评估自评
    List<SecurityRiskAssessmentBarListVO> getSecurityRiskAssessmentBarListVO(@Param("param") BaseParam param);


    /**
     * 获取平台和评估volist
     *
     * @param param 参数
     * @return {@link List }<{@link PlatformsAndAssessmentVO }>
     */
    List<PlatformsAndAssessmentVO> getPlatformsAndAssessmentVO(@Param("param") BaseParam param);

}
