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

    <resultMap type="cn.cecep.talroad.domain.BMainNoiseEmissions" id="BMainNoiseEmissionsResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="noiseTypeId"    column="noise_type_id"    />
        <result property="productionPeriodDaytime"    column="production_period_daytime"    />
        <result property="productionPeriodNighttime"    column="production_period_nighttime"    />
        <result property="implementationEmissionStandards"    column="implementation_emission_standards"    />
        <result property="noiseEmissionsDaytime"    column="noise_emissions_daytime"    />
        <result property="noiseEmissionsNighttime"    column="noise_emissions_nighttime"    />
    </resultMap>


    <sql id="selectBMainNoiseEmissionsVo">
        select id, factory_id, noise_type_id, production_period_daytime, production_period_nighttime, implementation_emission_standards, noise_emissions_daytime, noise_emissions_nighttime from b_main_noise_emissions
    </sql>

    <select id="selectBMainNoiseEmissionsList" parameterType="cn.cecep.talroad.domain.BMainNoiseEmissions" resultMap="BMainNoiseEmissionsResult">
        <include refid="selectBMainNoiseEmissionsVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="noiseTypeId != null  and noiseTypeId != ''"> and noise_type_id = #{noiseTypeId}</if>
            <if test="productionPeriodDaytime != null  and productionPeriodDaytime != ''"> and production_period_daytime = #{productionPeriodDaytime}</if>
            <if test="productionPeriodNighttime != null  and productionPeriodNighttime != ''"> and production_period_nighttime = #{productionPeriodNighttime}</if>
            <if test="implementationEmissionStandards != null  and implementationEmissionStandards != ''"> and implementation_emission_standards = #{implementationEmissionStandards}</if>
            <if test="noiseEmissionsDaytime != null  and noiseEmissionsDaytime != ''"> and noise_emissions_daytime = #{noiseEmissionsDaytime}</if>
            <if test="noiseEmissionsNighttime != null  and noiseEmissionsNighttime != ''"> and noise_emissions_nighttime = #{noiseEmissionsNighttime}</if>
        </where>
    </select>

</mapper>
