<?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.SRaAreaRegulatoryIssuesMapper">

    <resultMap type="cn.cecep.talroad.domain.analysis.SRaAreaRegulatoryIssues" id="SRaAreaRegulatoryIssuesResult">
        <result property="id"    column="id"    />
        <result property="reportType"    column="report_type"    />
        <result property="districtName"    column="district_name"    />
        <result property="districtCode"    column="district_code"    />
        <result property="industryCategory"    column="industry_category"    />
        <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="totalEnterprises"    column="total_enterprises"    />
        <result property="submissionRate"    column="submission_rate"    />
        <result property="problemsEnterprises"    column="problems_enterprises"    />
        <result property="normativeQuestionRate"    column="normative_question_rate"    />
        <result property="reportResultStatisticalTime"    column="report_result_statistical_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="selectSRaAreaRegulatoryIssuesVo">
        select id, report_type, district_name, district_code, industry_category, 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, total_enterprises, submission_rate, problems_enterprises, normative_question_rate, report_result_statistical_time, create_by, create_time, update_by, update_time from s_ra_area_regulatory_issues
    </sql>

    <select id="selectSRaAreaRegulatoryIssuesList" parameterType="cn.cecep.talroad.domain.analysis.SRaAreaRegulatoryIssues" resultMap="SRaAreaRegulatoryIssuesResult">
        <include refid="selectSRaAreaRegulatoryIssuesVo"/>
        <where>
            <if test="reportType != null  and reportType != ''"> and report_type = #{reportType}</if>
            <if test="districtName != null  and districtName != ''"> and district_name like concat('%', #{districtName}, '%')</if>
            <if test="districtCode != null  and districtCode != ''"> and district_code = #{districtCode}</if>
            <if test="industryCategory != null  and industryCategory != ''"> and industry_category = #{industryCategory}</if>
            <if test="month != null  and month != ''"> and month = #{month}</if>
            <if test="abnormalProblemsNum != null "> and abnormal_problems_num = #{abnormalProblemsNum}</if>
            <if test="effectiveMonitoringComplianceRate != null  and effectiveMonitoringComplianceRate != ''"> and effective_monitoring_compliance_rate = #{effectiveMonitoringComplianceRate}</if>
            <if test="onlineMonitoringComplianceRate != null "> and online_monitoring_compliance_rate = #{onlineMonitoringComplianceRate}</if>
            <if test="manualMonitoringFrequencyPassRate != null "> and manual_monitoring_frequency_pass_rate = #{manualMonitoringFrequencyPassRate}</if>
            <if test="sysAccActualEmissionPassRate != null "> and sys_acc_actual_emission_pass_rate = #{sysAccActualEmissionPassRate}</if>
            <if test="reportActualEmissionPassRate != null "> and report_actual_emission_pass_rate = #{reportActualEmissionPassRate}</if>
            <if test="heavyPollutionControlExacutiveRate != null "> and heavy_pollution_control_exacutive_rate = #{heavyPollutionControlExacutiveRate}</if>
            <if test="totalEnterprises != null "> and total_enterprises = #{totalEnterprises}</if>
            <if test="submissionRate != null "> and submission_rate = #{submissionRate}</if>
            <if test="problemsEnterprises != null "> and problems_enterprises = #{problemsEnterprises}</if>
            <if test="normativeQuestionRate != null "> and normative_question_rate = #{normativeQuestionRate}</if>
            <if test="reportResultStatisticalTime != null "> and report_result_statistical_time = #{reportResultStatisticalTime}</if>
        </where>
    </select>

</mapper>
