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

    <resultMap type="cn.cecep.talroad.domain.BMainEmissionOnlineMonWater" id="BMainEmissionOnlineMonWaterResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="factoryName"    column="factory_name"    />
        <result property="monName"    column="mon_name"    />
        <result property="pollutionCategory"    column="pollution_category"    />
        <result property="outletCode"    column="outlet_code"    />
        <result property="outletType"    column="outlet_type"    />
        <result property="pollutionType"    column="pollution_type"    />
        <result property="monitoningTime"    column="monitoning_time"    />
        <result property="meanConcentrationDay"    column="mean_concentration_day"    />
        <result property="meanUnit"    column="mean_unit"    />
        <result property="flueGasFlowRate"    column="flue_gas_flow_rate"    />
        <result property="pollutionDischarge"    column="pollution_discharge"    />
        <result property="whetherEffective"    column="whether_effective"    />
        <result property="revisingDischarge"    column="revising_discharge"    />
        <result property="revisingExplain"    column="revising_explain"    />
        <result property="inclusionCalculationDischarge"    column="inclusion_calculation_discharge"    />
        <result property="tagExplain"    column="tag_explain"    />
    </resultMap>


    <sql id="selectBMainEmissionOnlineMonWaterVo">
        select id, factory_id, factory_name, mon_name, pollution_category, outlet_code, outlet_type, pollution_type, monitoning_time, mean_concentration_day, mean_unit, flue_gas_flow_rate, pollution_discharge, whether_effective, revising_discharge, revising_explain, inclusion_calculation_discharge, tag_explain from b_main_emission_online_mon_water
    </sql>

    <select id="selectBMainEmissionOnlineMonWaterList" parameterType="cn.cecep.talroad.domain.BMainEmissionOnlineMonWater" resultMap="BMainEmissionOnlineMonWaterResult">
        <include refid="selectBMainEmissionOnlineMonWaterVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="factoryName != null  and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
            <if test="monName != null  and monName != ''"> and mon_name like concat('%', #{monName}, '%')</if>
            <if test="pollutionCategory != null  and pollutionCategory != ''"> and pollution_category = #{pollutionCategory}</if>
            <if test="outletCode != null  and outletCode != ''"> and outlet_code = #{outletCode}</if>
            <if test="outletType != null  and outletType != ''"> and outlet_type = #{outletType}</if>
            <if test="pollutionType != null  and pollutionType != ''"> and pollution_type = #{pollutionType}</if>
            <if test="monitoningTime != null "> and monitoning_time = #{monitoningTime}</if>
            <if test="meanConcentrationDay != null  and meanConcentrationDay != ''"> and mean_concentration_day = #{meanConcentrationDay}</if>
            <if test="meanUnit != null  and meanUnit != ''"> and mean_unit = #{meanUnit}</if>
            <if test="flueGasFlowRate != null  and flueGasFlowRate != ''"> and flue_gas_flow_rate = #{flueGasFlowRate}</if>
            <if test="pollutionDischarge != null  and pollutionDischarge != ''"> and pollution_discharge = #{pollutionDischarge}</if>
            <if test="whetherEffective != null  and whetherEffective != ''"> and whether_effective = #{whetherEffective}</if>
            <if test="revisingDischarge != null  and revisingDischarge != ''"> and revising_discharge = #{revisingDischarge}</if>
            <if test="revisingExplain != null  and revisingExplain != ''"> and revising_explain = #{revisingExplain}</if>
            <if test="inclusionCalculationDischarge != null  and inclusionCalculationDischarge != ''"> and inclusion_calculation_discharge = #{inclusionCalculationDischarge}</if>
        </where>
    </select>

</mapper>
