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

    <resultMap type="cn.cecep.talroad.domain.BMainPollDisWaterSout" id="BMainPollDisWaterSoutResult">
        <result property="soutId"    column="sout_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="pollDisId"    column="poll_dis_id"    />
        <result property="pollutantType"    column="pollutant_type"    />
        <result property="outletCode"    column="outlet_code"    />
        <result property="outletName"    column="outlet_name"    />
        <result property="pollutantsType"    column="pollutants_type"    />
        <result property="pollutantsTimeFrame"    column="pollutants_time_frame"    />
        <result property="pollutantsConcentration"    column="pollutants_concentration"    />
        <result property="pollutantsDis"    column="pollutants_dis"    />
        <result property="otherDetail"    column="other_detail"    />
    </resultMap>


    <sql id="selectBMainPollDisWaterSoutVo">
        select sout_id, factory_id, poll_dis_id, pollutant_type, outlet_code, outlet_name, pollutants_type, pollutants_time_frame, pollutants_concentration, pollutants_dis, other_detail from b_main_poll_dis_water_sout
    </sql>

    <select id="selectBMainPollDisWaterSoutList" parameterType="cn.cecep.talroad.domain.BMainPollDisWaterSout" resultMap="BMainPollDisWaterSoutResult">
        <include refid="selectBMainPollDisWaterSoutVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="pollDisId != null  and pollDisId != ''"> and poll_dis_id = #{pollDisId}</if>
            <if test="pollutantType != null  and pollutantType != ''"> and pollutant_type = #{pollutantType}</if>
            <if test="........pg.dropped.5........ != null  and ........pg.dropped.5........ != ''"> and ........pg.dropped.5........ = #{........pg.dropped.5........}</if>
            <if test="........pg.dropped.6........ != null  and ........pg.dropped.6........ != ''"> and ........pg.dropped.6........ = #{........pg.dropped.6........}</if>
            <if test="........pg.dropped.7........ != null  and ........pg.dropped.7........ != ''"> and ........pg.dropped.7........ = #{........pg.dropped.7........}</if>
            <if test="........pg.dropped.8........ != null  and ........pg.dropped.8........ != ''"> and ........pg.dropped.8........ = #{........pg.dropped.8........}</if>
            <if test="........pg.dropped.9........ != null  and ........pg.dropped.9........ != ''"> and ........pg.dropped.9........ = #{........pg.dropped.9........}</if>
            <if test="outletCode != null  and outletCode != ''"> and outlet_code = #{outletCode}</if>
            <if test="outletName != null  and outletName != ''"> and outlet_name like concat('%', #{outletName}, '%')</if>
            <if test="pollutantsType != null  and pollutantsType != ''"> and pollutants_type = #{pollutantsType}</if>
            <if test="pollutantsTimeFrame != null  and pollutantsTimeFrame != ''"> and pollutants_time_frame = #{pollutantsTimeFrame}</if>
            <if test="pollutantsConcentration != null  and pollutantsConcentration != ''"> and pollutants_concentration = #{pollutantsConcentration}</if>
            <if test="pollutantsDis != null  and pollutantsDis != ''"> and pollutants_dis = #{pollutantsDis}</if>
            <if test="otherDetail != null  and otherDetail != ''"> and other_detail = #{otherDetail}</if>
        </where>
    </select>

</mapper>
