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

    <resultMap type="cn.cecep.talroad.domain.BMainPollDisNoise" id="BMainPollDisNoiseResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="pollDisId"    column="poll_dis_id"    />
        <result property="noiseType"    column="noise_type"    />
        <result property="productionTimeDay"    column="production_time_day"    />
        <result property="productionTimeNight"    column="production_time_night"    />
        <result property="emissionStandardsName"    column="emission_standards_name"    />
        <result property="noiseOuelatDay"    column="noise_ouelat_day"    />
        <result property="noiseOuelatNight"    column="noise_ouelat_night"    />
        <result property="otherInformation"    column="other_information"    />
    </resultMap>


    <sql id="selectBMainPollDisNoiseVo">
        select id, factory_id, poll_dis_id, noise_type, production_time_day, production_time_night, emission_standards_name, noise_ouelat_day, noise_ouelat_night, other_information from b_main_poll_dis_noise
    </sql>

    <select id="selectBMainPollDisNoiseList" parameterType="cn.cecep.talroad.domain.BMainPollDisNoise" resultMap="BMainPollDisNoiseResult">
        <include refid="selectBMainPollDisNoiseVo"/>
        <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="noiseType != null  and noiseType != ''"> and noise_type = #{noiseType}</if>
            <if test="productionTimeDay != null  and productionTimeDay != ''"> and production_time_day = #{productionTimeDay}</if>
            <if test="productionTimeNight != null  and productionTimeNight != ''"> and production_time_night = #{productionTimeNight}</if>
            <if test="emissionStandardsName != null  and emissionStandardsName != ''"> and emission_standards_name like concat('%', #{emissionStandardsName}, '%')</if>
            <if test="noiseOuelatDay != null  and noiseOuelatDay != ''"> and noise_ouelat_day = #{noiseOuelatDay}</if>
            <if test="noiseOuelatNight != null  and noiseOuelatNight != ''"> and noise_ouelat_night = #{noiseOuelatNight}</if>
            <if test="otherInformation != null  and otherInformation != ''"> and other_information = #{otherInformation}</if>
        </where>
    </select>

</mapper>
