<?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.analysis.SRaAbNalysisCarMapper">

    <resultMap type="cn.cecep.talroad.domain.analysis.SRaAbNalysisCar" id="SRaAbNalysisCarResult">
        <result property="dataId"    column="data_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="factoryName"    column="factory_name"    />
        <result property="industryCategoryName"    column="industry_category_name"    />
        <result property="industryCategoryCode"    column="industry_category_code"    />
        <result property="districtName"    column="district_name"    />
        <result property="districtCode"    column="district_code"    />
        <result property="performanceLevel"    column="performance_level"    />
        <result property="workingProcedure"    column="working_procedure"    />
        <result property="inOutNumber"    column="in_out_number"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="analyseTime"    column="analyse_time"    />
    </resultMap>


    <sql id="selectSRaAbNalysisCarVo">
        select data_id, factory_id, factory_name, industry_category_name, industry_category_code, district_name, district_code, performance_level, working_procedure, in_out_number, update_time, create_time, analyse_time from s_ra_ab_nalysis_car
    </sql>

    <select id="selectSRaAbNalysisCarList" parameterType="cn.cecep.talroad.domain.analysis.SRaAbNalysisCar" resultMap="SRaAbNalysisCarResult">
        <include refid="selectSRaAbNalysisCarVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="factoryName != null  and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
            <if test="industryCategoryName != null  and industryCategoryName != ''"> and industry_category_name like concat('%', #{industryCategoryName}, '%')</if>
            <if test="industryCategoryCode != null  and industryCategoryCode != ''"> and industry_category_code = #{industryCategoryCode}</if>
            <if test="districtName != null  and districtName != ''"> and district_name like concat('%', #{districtName}, '%')</if>
            <if test="districtCode != null  and districtCode != ''"> and district_code = #{districtCode}</if>
            <if test="performanceLevel != null  and performanceLevel != ''"> and performance_level = #{performanceLevel}</if>
            <if test="workingProcedure != null  and workingProcedure != ''"> and working_procedure = #{workingProcedure}</if>
            <if test="inOutNumber != null "> and in_out_number = #{inOutNumber}</if>
            <if test="analyseTime != null  and analyseTime != ''"> and analyse_time = #{analyseTime}</if>
        </where>
    </select>

</mapper>
