<?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.zhjc.mapper.ZhjcPtgsdLwzsMapper">

    <resultMap id="ZhjcPtgsdLwzsMap" type="com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcPtgsdLwzs">

    </resultMap>


    <select id="selectGdlwzs" resultMap="ZhjcPtgsdLwzsMap">
        SELECT
        cs.id,
        cs.luxianbianhao as lxbh,
        cs.luxianmingcheng as lxmc,
        cs.pingjunxingshisudu as pjss,
        cs.guancelicheng as gclc,
        cs.nian as `year`,
        jtl.jiaotongyongjidu as yjd,
        jtl.shiyingjiaotongliang as syjtl
        FROM
        t_lwjc_ptgdlxpjxscs cs,
        t_lwjc_gdlxjtl jtl
        <where>
            cs.luxianbianhao = jtl.luxianbianhao
            AND cs.nian = jtl.nian
            <if test="year !=null">
                AND jtl.nian =#{year}
            </if>
        </where>
        order by yjd desc
    </select>

    <select id="selectSdlwzs" resultMap="ZhjcPtgsdLwzsMap">
        SELECT
        cs.id,
        cs.luxianbianhao as lxbh,
        cs.luxianmingcheng as lxmc,
        cs.pingjunxingshisudu as pjss,
        cs.guancelicheng as gclc,
        cs.nian as `year`,
        jtl.jiaotongyongjidu as yjd,
        jtl.shiyingjiaotongliang as syjtl
        FROM
        t_lwjc_ptsdlxpjxscs cs,
        t_lwjc_sdlxjtl jtl
        <where>
            cs.luxianbianhao = jtl.luxianbianhao
            AND cs.nian = jtl.nian
            <if test="year !=null">
                AND jtl.nian =#{year}
            </if>
        </where>
        order by yjd desc
    </select>
</mapper>
