<?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="com.elephant.framework.galaxy.aroad.module.szgl.mapper.SzglGsdGczMapper">

    <resultMap id="szglGsdGczMap" type="com.elephant.framework.galaxy.aroad.module.szgl.entity.SzglGsdGcz">
        <id property="id" column="id"/>
        <result property="gczbh" column="gczbh"/>
        <result property="gczmc" column="gczmc"/>
        <result property="lxbh" column="lxbh"/>
        <result property="lxmc" column="lxmc"/>
        <result property="xzqh" column="xzqh"/>
        <result property="gczlx" column="gczlx"/>
        <result property="gczzh" column="gczzh"/>
        <result property="qdzh" column="qdzh"/>
        <result property="zdzh" column="zdzh"/>
        <result property="gclc" column="gclc"/>
        <result property="qdmc" column="qdmc"/>
        <result property="zdmc" column="zdmc"/>
        <result property="jsdj" column="jsdj"/>
        <result property="xcds" column="xcds"/>
        <result property="mclx" column="mclx"/>
        <result property="lmkd" column="lmkd"/>
        <result property="sjss" column="sjss"/>
        <result property="dx" column="dx"/>
        <result property="tcyf" column="tcyf"/>
        <result property="lxbm" column="lxbm"/>
        <result property="zh" column="zh"/>
        <result property="jd" column="jd"/>
        <result property="wd" column="wd"/>
        <result property="gs" column="gs"/>
        <result property="nian" column="nian"/>
        <collection property="trfList"
                    ofType="com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection">
            <result property="jdcCurrentAmount" column="jdcCurrentAmount"/>
            <result property="jdcNaturalAmount" column="jdcNaturalAmount"/>
            <result property="year" column="year"/>
        </collection>
    </resultMap>
    <select id="getGczJtl" resultType="com.elephant.framework.galaxy.aroad.module.szgl.entity.SzglGsdGcz">
        select gcz.*,
        jtl.JDC_current_amount as jdcCurrentAmount,
        jtl.JDC_natural_amount as jdcNaturalAmount,
        jtl.year


        from t_szgl_gsd_gcz gcz
        left join v_traffic_roadsection jtl on gcz.gczbh =jtl.spot_code
        <where>

            <if test="lxbh !=null and lxbh !''">
                gcz.lxbh =#{lxbh}
            </if>
            <if test="zxzh !=null">
                gcz.qdzh <![CDATA[ <= ]]>#{zxzh} and gcz.zdzh <![CDATA[ >= ]]>#{zxzh}

            </if>


        </where>

    </select>


</mapper>
