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

    <resultMap type="cn.cecep.talroad.domain.BMainEmissionSourceAir" id="BMainEmissionSourceAirResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="pollYear"    column="poll_year"    />
        <result property="pollutionCategory"    column="pollution_category"    />
        <result property="systematicAccountingSo2"    column="systematic_accounting_so2"    />
        <result property="actionReportsSo2"    column="action_reports_so2"    />
        <result property="permissionSo2"    column="permission_so2"    />
    </resultMap>


    <sql id="selectBMainEmissionSourceAirVo">
        select id, factory_id, poll_year, pollution_category, systematic_accounting_so2, action_reports_so2, permission_so2 from b_main_emission_source_air
    </sql>

    <select id="selectBMainEmissionSourceAirList" parameterType="cn.cecep.talroad.domain.BMainEmissionSourceAir" resultMap="BMainEmissionSourceAirResult">
        <include refid="selectBMainEmissionSourceAirVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="pollYear != null  and pollYear != ''"> and poll_year = #{pollYear}</if>
            <if test="pollutionCategory != null  and pollutionCategory != ''"> and pollution_category = #{pollutionCategory}</if>
            <if test="systematicAccountingSo2 != null  and systematicAccountingSo2 != ''"> and systematic_accounting_so2 = #{systematicAccountingSo2}</if>
            <if test="actionReportsSo2 != null  and actionReportsSo2 != ''"> and action_reports_so2 = #{actionReportsSo2}</if>
            <if test="permissionSo2 != null  and permissionSo2 != ''"> and permission_so2 = #{permissionSo2}</if>
        </where>
    </select>

</mapper>
