<?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.zhyh.mapper.ZhyhDzxgcglGcxxMapper">

    <resultMap id="zhyhDzxgcglGcxxMap" type="com.elephant.framework.galaxy.aroad.module.zhyh.entity.ZhyhDzxgcglGcxx">
        <id property="id" column="id"/>
        <result property="gcmc" column="gcmc"/>
        <result property="gclx" column="gclx"/>
        <result property="htmc" column="htmc"/>
        <result property="gydw" column="gydw"/>
        <result property="gcksrq" column="gcksrq"/>
        <result property="gcjsrq" column="gcjsrq"/>
        <result property="zbksrq" column="zbksrq"/>
        <result property="zbjsrq" column="zbjsrq"/>
        <result property="zbdw" column="zbdw"/>
        <result property="jldw" column="jldw"/>
        <result property="lxbh" column="lxbh"/>
        <result property="xsfx" column="xsfx"/>
        <result property="wzms" column="wzms"/>
        <result property="gcqdzh" column="gcqdzh"/>
        <result property="gcjszh" column="gcjszh"/>
        <result property="lrr" column="lrr"/>
        <result property="lrsj" column="lrsj"/>
        <result property="dtzb" column="dtzb"/>
        <result property="bz" column="bz"/>
        <result property="creator" column="creator"/>
        <result property="createTime" column="create_time"/>
        <result property="updatePerson" column="update_person"/>
        <result property="updateTime" column="update_time"/>
        <result property="status" column="status"/>
        <result property="delFlag" column="del_flag"/>
        <result property="remarks" column="remarks"/>
    </resultMap>
    <select id="selectGcxxTreeGroupByGydw" resultType="String">
        select gydw from t_zhyh_dzxgcgl_gcxx GROUP BY gydw
      </select>
    <select id="getJYlsForQS" resultMap="zhyhDzxgcglGcxxMap">
        select * from t_zhyh_dzxgcgl_gcxx
        <where>
            <if test="lxbh !=null and lxbh !=''">
                lxbh =#{lxbh}
            </if>
            <if test="zxzh !=null">
                and gcqdzh <![CDATA[ <= ]]>#{zxzh} and gcjszh <![CDATA[ >= ]]>#{zxzh}
            </if>
        </where>
        order by gcksrq
    </select>
    <select id="getJYlsForRoad" resultMap="zhyhDzxgcglGcxxMap">
        select * from t_zhyh_dzxgcgl_gcxx
        <where>
            <if test="lxbh !=null and lxbh !=''">
                lxbh =#{lxbh}
            </if>
            <if test="qdzh !=null">
                and(gcqdzh <![CDATA[ <= ]]>#{qdzh} and gcjszh <![CDATA[ >= ]]>#{qdzh}) or (gcqdzh <![CDATA[ <= ]]>#{zdzh} and gcjszh <![CDATA[ >= ]]>#{zdzh})
            </if>
        </where>
        order by gcksrq

    </select>
</mapper>
