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

  <resultMap id="zhjcXmjcGhxmMap" type="com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcXmjcGhxm">
        <id property="id" column="id"/>
        <result property="xmlx" column="xmlx"/>
        <result property="lxbh" column="lxbh"/>
        <result property="xmmc" column="xmmc"/>
        <result property="city" column="city"/>
        <result property="tzqbh" column="tzqbh"/>
        <result property="jsxz" column="jsxz"/>
        <result property="lc" column="lc"/>
        <result property="ztz" column="ztz"/>
        <result property="ztzZyhstz" column="ztz_zyhstz"/>
        <result property="wnjhtz" column="wnjhtz"/>
        <result property="wnjhtzZyhstz" column="wnjhtz_zyhstz"/>
        <result property="qzdzh" column="qzdzh"/>
        <result property="jsdj" column="jsdj"/>
        <result property="ljkd" column="ljkd"/>
        <result property="lmkd" column="lmkd"/>
        <result property="gjjdzxsj" column="gjjdzxsj"/>
        <result property="jtl" column="jtl"/>
        <result property="pci" column="pci"/>
        <result property="ncyJsdj" column="ncy_jsdj"/>
        <result property="ncyLjkd" column="ncy_ljkd"/>
        <result property="jsnxQsn" column="jsnx_qsn"/>
        <result property="jsnxJcn" column="jsnx_jcn"/>
        <result property="jzqk" column="jzqk"/>
        <result property="bz" column="bz"/>
        <result property="snBstz" column="sn_bstz"/>
        <result property="snZytz" column="sn_zytz"/>
        <result property="bnBstz" column="bn_bstz"/>
        <result property="bnZytz" column="bn_zytz"/>
        <result property="ncljwctz" column="ncljwctz"/>
        <result property="tjsj" column="tjsj"/>
        <result property="ghmc" column="ghmc"/>
        <result property="createTime" column="create_time"/>
        <collection property="shapeList" ofType="com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcXmjcGhxmShape" resultMap="com.elephant.framework.galaxy.aroad.module.zhjc.mapper.ZhjcXmjcGhxmeShapMapper.zhjcXmjcGhxmShapeMap">

        </collection>

  </resultMap>
      <select id="selectGhxm" parameterType="com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcXmjcGhxm" resultMap="zhjcXmjcGhxmMap">
       select xm.*,shape.code,shape.shape
       from t_zhjc_xmjc_ghxm xm
       left join t_zhjc_xmjc_ghxm_shape shape on xm.xmmc = shape.name
      <where>
            <if test="ghxm.city!=null and ghxm.city !=''">
                  xm.city = #{ghxm.city}
            </if>
            <if test="ghxm.jsdj !=null and ghxm.jsdj !=''">
                  and xm.jsdj  LIKE CONCAT(CONCAT('%', #{ghxm.jsdj}), '%')
            </if>
            <if test="ghxm.jsxz !=null and ghxm.jsxz !=''">
                  and xm.jsxz = #{ghxm.jsxz}
            </if>
            <if test="ghxm.jzqk !=null and ghxm.jzqk !=''">
                  and xm.jzqk = #{ghxm.jzqk}
            </if>
      </where>
        order by xm.id
      </select>

      <select id="selectGCGhxm" parameterType="com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcXmjcGhxm" resultMap="zhjcXmjcGhxmMap">
            select xm.*,shape.code,shape.shape
            from t_zhjc_xmjc_ghxm xm
            left join t_zhjc_xmjc_ghxm_shape shape on xm.xmmc = shape.name
            where xm.jzqk = '在建'
            order by xm.id
      </select>
</mapper>
