<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.cecep.talroad.mapper.analysis.SRaFactoryRegulatoryIssuesMapper">

    <resultMap type="cn.cecep.talroad.domain.analysis.SRaFactoryRegulatoryIssues" id="SRaFactoryRegulatoryIssuesResult">
        <result property="id"    column="id"    />
        <result property="reportType"    column="report_type"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="pollDisLicenseCode"    column="poll_dis_license_code"    />
        <result property="month"    column="month"    />
        <result property="abnormalProblemsNum"    column="abnormal_problems_num"    />
        <result property="effectiveMonitoringComplianceRate"    column="effective_monitoring_compliance_rate"    />
        <result property="onlineMonitoringComplianceRate"    column="online_monitoring_compliance_rate"    />
        <result property="manualMonitoringFrequencyPassRate"    column="manual_monitoring_frequency_pass_rate"    />
        <result property="sysAccActualEmissionPassRate"    column="sys_acc_actual_emission_pass_rate"    />
        <result property="reportActualEmissionPassRate"    column="report_actual_emission_pass_rate"    />
        <result property="heavyPollutionControlExacutiveRate"    column="heavy_pollution_control_exacutive_rate"    />
        <result property="reportNeedSubmit"    column="report_need_submit"    />
        <result property="reportSubmit"    column="report_submit"    />
        <result property="reportNormative"    column="report_normative"    />
        <result property="reportStatisticsTime"    column="report_statistics_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>


    <sql id="selectSRaFactoryRegulatoryIssuesVo">
        select id, report_type, factory_id, poll_dis_license_code, month, abnormal_problems_num, effective_monitoring_compliance_rate, online_monitoring_compliance_rate, manual_monitoring_frequency_pass_rate, sys_acc_actual_emission_pass_rate, report_actual_emission_pass_rate, heavy_pollution_control_exacutive_rate, report_need_submit, report_submit, report_normative, report_statistics_time, create_by, create_time, update_by, update_time from s_ra_factory_regulatory_issues
    </sql>


    <select id="selectSRaFactoryRegulatoryIssuesList" parameterType="cn.cecep.talroad.domain.analysis.SRaFactoryRegulatoryIssues" resultMap="SRaFactoryRegulatoryIssuesResult">
        select
        srfri.ID,
        srfri.report_type,
        srfri.factory_id,
        srfri.poll_dis_license_code,
        srfri.MONTH,
        srfri.abnormal_problems_num,
        srfri.effective_monitoring_compliance_rate,
        srfri.online_monitoring_compliance_rate,
        srfri.manual_monitoring_frequency_pass_rate,
        srfri.sys_acc_actual_emission_pass_rate,
        srfri.report_actual_emission_pass_rate,
        srfri.heavy_pollution_control_exacutive_rate,
        srfri.report_need_submit,
        srfri.report_submit,
        srfri.report_normative,
        srfri.report_statistics_time,
        srfri.create_by,
        srfri.create_time,
        srfri.update_by,
        srfri.update_time
        FROM
        s_ra_factory_regulatory_issues  AS srfri
        left join pc_factory pf on srfri.factory_id = pf.id
        ${ew.customSqlSegment}
    </select>

    <select id="selectSRaFactoryRegulatoryIssuesPage" resultMap="SRaFactoryRegulatoryIssuesResult">
        <include refid="selectSRaFactoryRegulatoryIssuesVo"/>
        left join pc_factory pf on srfri.factory_id = pf.id
        ${ew.customSqlSegment}
    </select>

</mapper>
