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

    <resultMap type="cn.cecep.talroad.domain.BMainEmissionSourceWater" id="BMainEmissionSourceWaterResult">
        <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="systematicAccountingCod"    column="systematic_accounting_cod"    />
        <result property="actionReportsCod"    column="action_reports_cod"    />
        <result property="permissionCod"    column="permission_cod"    />
    </resultMap>


    <sql id="selectBMainEmissionSourceWaterVo">
        select id, factory_id, poll_year, pollution_category, systematic_accounting_cod, action_reports_cod, permission_cod from b_main_emission_source_water
    </sql>

    <select id="selectBMainEmissionSourceWaterList" parameterType="cn.cecep.talroad.domain.BMainEmissionSourceWater" resultMap="BMainEmissionSourceWaterResult">
        <include refid="selectBMainEmissionSourceWaterVo"/>
        <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="systematicAccountingCod != null  and systematicAccountingCod != ''"> and systematic_accounting_cod = #{systematicAccountingCod}</if>
            <if test="actionReportsCod != null  and actionReportsCod != ''"> and action_reports_cod = #{actionReportsCod}</if>
            <if test="permissionCod != null  and permissionCod != ''"> and permission_cod = #{permissionCod}</if>
        </where>
    </select>

</mapper>
