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

  <resultMap id="zhjcXmjcZtxmDtlMap" type="com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcXmjcZtxmDtl">
        <id property="id" column="id"/>
        <result property="year" column="year"/>
        <result property="lxbm" column="lxbm"/>
        <result property="city" column="city"/>
        <result property="lxmc" column="lxmc"/>
        <result property="qdmc" column="qdmc"/>
        <result property="zdmc" column="zdmc"/>
        <result property="qdzh" column="qdzh"/>
        <result property="zdzh" column="zdzh"/>
        <result property="lc" column="lc"/>
        <result property="cfldbh" column="cfldbh"/>
        <result property="cfldQdzh" column="cfld_qdzh"/>
        <result property="cfldZdzh" column="cfld_zdzh"/>

  </resultMap>
      <select id="getList" resultMap="zhjcXmjcZtxmDtlMap">
          select  dtl.*,shape.shape
          from t_zhjc_xmjc_ztxm_dtl dtl
          LEFT JOIN
          t_zhjc_xmjc_ztxm_dtl_shape shape
          on
          dtl.lxmc = shape.lxmc and dtl.qdzh =shape.qdzh and dtl.zdzh = shape.zdzh
            <where>
                <if test="wr.year !=null">
                    dtl.year  =#{wr.year}
                </if>
            </where>
            order by dtl.id
      </select>
</mapper>
