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

    <resultMap type="cn.cecep.talroad.domain.PcPollutant" id="PcPollutantResult">
        <result property="id"    column="id"    />
        <result property="pollCategory"    column="poll_category"    />
        <result property="pollName"    column="poll_name"    />
        <result property="pollCode"    column="poll_code"    />
        <result property="pollUnit"    column="poll_unit"    />
        <result property="emissionsLaws"    column="emissions_laws"    />
        <result property="executiveStandard"    column="executive_standard"    />
    </resultMap>


    <sql id="selectPcPollutantVo">
        select id, poll_category, poll_name, poll_code, poll_unit, emissions_laws, executive_standard from pc_pollutant
    </sql>

    <select id="selectPcPollutantList" parameterType="cn.cecep.talroad.domain.PcPollutant" resultMap="PcPollutantResult">
        <include refid="selectPcPollutantVo"/>
        <where>
            <if test="pollCategory != null  and pollCategory != ''"> and poll_category = #{pollCategory}</if>
            <if test="pollName != null  and pollName != ''"> and poll_name like concat('%', #{pollName}, '%')</if>
            <if test="pollCode != null  and pollCode != ''"> and poll_code = #{pollCode}</if>
            <if test="pollUnit != null  and pollUnit != ''"> and poll_unit = #{pollUnit}</if>
            <if test="emissionsLaws != null  and emissionsLaws != ''"> and emissions_laws = #{emissionsLaws}</if>
            <if test="executiveStandard != null  and executiveStandard != ''"> and executive_standard = #{executiveStandard}</if>
        </where>
    </select>

</mapper>
