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

    <resultMap type="cn.cecep.talroad.domain.BMainEmissionPollutionSolidWaste" id="BMainEmissionPollutionSolidWasteResult">
        <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="dataSource"    column="data_source"    />
        <result property="solidWasteType"    column="solid_waste_type"    />
        <result property="solidWasteName"    column="solid_waste_name"    />
        <result property="annualPlannedOutput"    column="annual_planned_output"    />
        <result property="annualActualProduction"    column="annual_actual_production"    />
        <result property="annualStorageCapacity"    column="annual_storage_capacity"    />
        <result property="annualTransferVolume"    column="annual_transfer_volume"    />
        <result property="annualDisposalUtilization"    column="annual_disposal_utilization"    />
    </resultMap>


    <sql id="selectBMainEmissionPollutionSolidWasteVo">
        select id, factory_id, poll_year, pollution_category, data_source, solid_waste_type, solid_waste_name, annual_planned_output, annual_actual_production, annual_storage_capacity, annual_transfer_volume, annual_disposal_utilization from b_main_emission_pollution_solid_waste
    </sql>

    <select id="selectBMainEmissionPollutionSolidWasteList" parameterType="cn.cecep.talroad.domain.BMainEmissionPollutionSolidWaste" resultMap="BMainEmissionPollutionSolidWasteResult">
        <include refid="selectBMainEmissionPollutionSolidWasteVo"/>
        <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="dataSource != null  and dataSource != ''"> and data_source = #{dataSource}</if>
            <if test="solidWasteType != null  and solidWasteType != ''"> and solid_waste_type = #{solidWasteType}</if>
            <if test="solidWasteName != null  and solidWasteName != ''"> and solid_waste_name like concat('%', #{solidWasteName}, '%')</if>
            <if test="annualPlannedOutput != null  and annualPlannedOutput != ''"> and annual_planned_output = #{annualPlannedOutput}</if>
            <if test="annualActualProduction != null  and annualActualProduction != ''"> and annual_actual_production = #{annualActualProduction}</if>
            <if test="annualStorageCapacity != null  and annualStorageCapacity != ''"> and annual_storage_capacity = #{annualStorageCapacity}</if>
            <if test="annualTransferVolume != null  and annualTransferVolume != ''"> and annual_transfer_volume = #{annualTransferVolume}</if>
            <if test="annualDisposalUtilization != null  and annualDisposalUtilization != ''"> and annual_disposal_utilization = #{annualDisposalUtilization}</if>
        </where>
    </select>

</mapper>
